protected function rectangleLinearGradient(awLinearGradient $gradient, awPoint $p1, awPoint $p2) { list($x1, $y1) = $p1->getLocation(); list($x2, $y2) = $p2->getLocation(); if ($y1 - $y2 > 0) { if ($gradient->angle === 0) { $this->init($gradient, $y1 - $y2); for ($i = $y2; $i <= $y1; $i++) { $color = $this->color($i - $y2); $p1 = new awPoint($x1, $i); $p2 = new awPoint($x2, $i); $this->driver->filledRectangle($color, new awLine($p1, $p2)); unset($color); } } elseif ($gradient->angle === 90) { $this->init($gradient, $x2 - $x1); for ($i = $x1; $i <= $x2; $i++) { $color = $this->color($i - $x1); $p1 = new awPoint($i, $y2); $p2 = new awPoint($i, $y1); $this->driver->filledRectangle($color, new awLine($p1, $p2)); unset($color); } } } }
protected function drawImage(awPoint $point) { if ($this->image instanceof awImage) { $width = $this->image->width; $height = $this->image->height; list($x, $y) = $point->getLocation(); $x1 = (int) ($x - $width / 2); $x2 = $x1 + $width; $y1 = (int) ($y - $width / 2); $y2 = $y1 + $height; $this->border->rectangle($this->driver, new awPoint($x1 - 1, $y1 - 1), new awPoint($x2 + 1, $y2 + 1)); $this->driver->copyImage($this->image, new awPoint($x1, $y1), new awPoint($x2, $y2)); } }