From a549247a1144c8be6643cca05625a5498bd444b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Hu=CC=88bner?= Date: Sat, 17 Feb 2018 01:39:30 +0100 Subject: [PATCH] Do not print markers outside the image. --- src/ElementPrinter/Marker/ExtraMarkerPrinter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ElementPrinter/Marker/ExtraMarkerPrinter.php b/src/ElementPrinter/Marker/ExtraMarkerPrinter.php index 78522eb..f785791 100644 --- a/src/ElementPrinter/Marker/ExtraMarkerPrinter.php +++ b/src/ElementPrinter/Marker/ExtraMarkerPrinter.php @@ -75,7 +75,9 @@ class ExtraMarkerPrinter $point = new Point($destX, $destY); - $markerImage->paste($canvas->getImage(), $point); + if ($canvas->getImage()->getSize()->contains($markerImage->getSize(), $point)) { + $markerImage->paste($canvas->getImage(), $point); + } return $this; }