Skip to content

Commit 0e46722

Browse files
committed
Render a line for a path segment with a radius of zero
fixes #97
1 parent 964d9a9 commit 0e46722

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Svg/Tag/Path.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,12 @@ function drawArc(SurfaceInterface $surface, $fx, $fy, $coords)
449449
$toX = $tx - $fx;
450450
$toY = $ty - $fy;
451451

452-
if ($toX + $toY === 0) {
452+
if ((float)($toX + $toY) === 0.0) {
453+
return;
454+
}
455+
456+
if ((float)abs($rx) == 0.0 || (float)abs($ry) === 0.0) {
457+
$surface->lineTo($tx, $ty);
453458
return;
454459
}
455460

0 commit comments

Comments
 (0)