/** * {@inheritdoc} */ protected function doApply(CanvasInterface $canvas) { $width = $canvas->getWidth(); $height = $canvas->getHeight(); $line = new Line(); $line->setColor($this->getColor()); for ($x = 1; $x <= $width; $x += $this->getSize()) { $line->getStart()->move($x, 0); $line->getEnd()->move($x, $height); $line->draw($canvas); } for ($y = 1; $y <= $height; $y += $this->getSize()) { $line->getStart()->move(0, $y); $line->getEnd()->move($width, $y); $line->draw($canvas); } }