Skip to content

Commit 4498b5d

Browse files
committed
Do not draw indeterminite arc paths
fixes #62
1 parent 583651c commit 4498b5d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Svg/Tag/Path.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,14 @@ function drawArc(SurfaceInterface $surface, $fx, $fy, $coords)
451451
array(),
452452
);
453453

454-
$segsNorm = $this->arcToSegments($tx - $fx, $ty - $fy, $rx, $ry, $large, $sweep, $rot);
454+
$toX = $tx - $fx;
455+
$toY = $ty - $fy;
456+
457+
if ($toX + $toY === 0) {
458+
return;
459+
}
460+
461+
$segsNorm = $this->arcToSegments($toX, $toY, $rx, $ry, $large, $sweep, $rot);
455462

456463
for ($i = 0, $len = count($segsNorm); $i < $len; $i++) {
457464
$segs[$i][0] = $segsNorm[$i][0] + $fx;

0 commit comments

Comments
 (0)