Differential D350 Diff 976 branches/5.2.x/core/units/general/libchart/classes/view/primitive/Rectangle.php
Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/general/libchart/classes/view/primitive/Rectangle.php
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
*/ | */ | ||||
public $y2; | public $y2; | ||||
/** | /** | ||||
* Creates a new rectangle | * Creates a new rectangle | ||||
* | * | ||||
* @param resource GD image resource | * @param resource GD image resource | ||||
*/ | */ | ||||
public function LibchartRectangle($x1, $y1, $x2, $y2) { | public function __construct($x1, $y1, $x2, $y2) { | ||||
$this->x1 = $x1; | $this->x1 = $x1; | ||||
$this->y1 = $y1; | $this->y1 = $y1; | ||||
$this->x2 = $x2; | $this->x2 = $x2; | ||||
$this->y2 = $y2; | $this->y2 = $y2; | ||||
} | } | ||||
/** | /** | ||||
* Apply a padding and returns the resulting rectangle. | * Apply a padding and returns the resulting rectangle. | ||||
* | * | ||||
* @return Resulting rectangle | * @return Resulting rectangle | ||||
*/ | */ | ||||
public function getPaddedRectangle($padding) { | public function getPaddedRectangle($padding) { | ||||
$rectangle = new LibchartRectangle( | $rectangle = new LibchartRectangle( | ||||
$this->x1 + $padding->left, | $this->x1 + $padding->left, | ||||
$this->y1 + $padding->top, | $this->y1 + $padding->top, | ||||
$this->x2 - $padding->right, | $this->x2 - $padding->right, | ||||
$this->y2 - $padding->bottom | $this->y2 - $padding->bottom | ||||
); | ); | ||||
//echo "(" . $this->x1 . "," . $this->y1 . ") (" . $this->x2 . "," . $this->y2 . ")<br>"; | //echo "(" . $this->x1 . "," . $this->y1 . ") (" . $this->x2 . "," . $this->y2 . ")<br>"; | ||||
return $rectangle; | return $rectangle; | ||||
} | } | ||||
} | } | ||||
No newline at end of file |