/** * {@inheritdoc} */ protected function doApply(CanvasInterface $canvas) { $dimension = $this->getBox()->getDimension(); $coordinate = $this->getBox()->getCoordinate(); $new = new Canvas($dimension); $new->paste($canvas, new Box($dimension, $coordinate), new Box($dimension)); $canvas->destroy(); $canvas->setHandler($new->getHandler()); }
/** * {@inheritdoc} */ public function draw(CanvasInterface $canvas, Border $border, StyleInterface $style = null) { $size = $border->getSize(); $new = new Canvas($canvas->getDimension()); $new->paste($canvas, null, new Box($canvas->getDimension()->translate(-$size, -$size + 1), new Coordinate($size / 2, $size / 2))); $in = new BorderIn(); $in->draw($new, $border, $style); $canvas->destroy(); $canvas->setHandler($new->getHandler()); return $this; }