WIP for copyright.
This commit is contained in:
parent
6008660afc
commit
84c138d738
@ -14,6 +14,9 @@ class CopyrightPrinter implements CopyrightPrinterInterface
|
|||||||
/** @var CanvasInterface $canvas */
|
/** @var CanvasInterface $canvas */
|
||||||
protected $canvas;
|
protected $canvas;
|
||||||
|
|
||||||
|
/** @var int $offset */
|
||||||
|
protected $offset = 10;
|
||||||
|
|
||||||
public function setCanvas(CanvasInterface $canvas): CopyrightPrinterInterface
|
public function setCanvas(CanvasInterface $canvas): CopyrightPrinterInterface
|
||||||
{
|
{
|
||||||
$this->canvas = $canvas;
|
$this->canvas = $canvas;
|
||||||
@ -26,7 +29,10 @@ class CopyrightPrinter implements CopyrightPrinterInterface
|
|||||||
$imagine = new Imagine();
|
$imagine = new Imagine();
|
||||||
$copyrightImage = $imagine->open($this->copyrightPath);
|
$copyrightImage = $imagine->open($this->copyrightPath);
|
||||||
|
|
||||||
$point = new Point(0,0);
|
$canvasSize = $this->canvas->getImage()->getSize();
|
||||||
|
$copyrightSize = $copyrightImage->getSize();
|
||||||
|
|
||||||
|
$point = new Point($canvasSize->getWidth() - $copyrightSize->getWidth() - $this->offset,$canvasSize->getHeight() - $copyrightSize->getHeight() - $this->offset);
|
||||||
|
|
||||||
$this->canvas->getImage()->paste($copyrightImage, $point);
|
$this->canvas->getImage()->paste($copyrightImage, $point);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user