From 9f2ea1b6885227d2c799ed209a2fd349bfe9bd21 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sat, 2 Mar 2024 13:50:18 +0100 Subject: [PATCH] Fix bug --- src/Drivers/Imagick/Modifiers/TextModifier.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Drivers/Imagick/Modifiers/TextModifier.php b/src/Drivers/Imagick/Modifiers/TextModifier.php index 4baa9a13..1ef9cbb7 100644 --- a/src/Drivers/Imagick/Modifiers/TextModifier.php +++ b/src/Drivers/Imagick/Modifiers/TextModifier.php @@ -126,13 +126,15 @@ class TextModifier extends AbstractTextModifier implements ModifierInterface ?ImagickDraw $draw = null, Point $offset = new Point(), ): void { - $frame->native()->annotateImage( - $draw, - $textline->position()->x() + $offset->x(), - $textline->position()->y() + $offset->y(), - $this->font->angle(), - (string) $textline - ); + if ($draw !== null) { + $frame->native()->annotateImage( + $draw, + $textline->position()->x() + $offset->x(), + $textline->position()->y() + $offset->y(), + $this->font->angle(), + (string) $textline + ); + } } /**