Skip to content

Commit e7d3e10

Browse files
committed
Emulation: fix text splitting
1 parent 6188a9b commit e7d3e10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Emulation/Canvas.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private function splitText(\ImagickDraw $canvas, string $text): array
123123
while(\count($words) > 0) {
124124
$metrics = $this->image->queryFontMetrics($canvas, \implode(' ', \array_slice($words, 0, $i)));
125125

126-
if ($metrics['textWidth'] > $this->width || \count($words) <= $i) {
126+
if ($metrics['textWidth'] > $this->width || \count($words) < $i) {
127127
$lineWidth[] = $metrics['textWidth'];
128128

129129
$lines[] = \implode(' ', \array_slice($words, 0, \max($i - 1, 1)));

0 commit comments

Comments
 (0)