Skip to content

Commit

Permalink
Do not draw indeterminite arc paths
Browse files Browse the repository at this point in the history
fixes #62
  • Loading branch information
bsweeney committed Mar 7, 2022
1 parent 583651c commit 4498b5d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Svg/Tag/Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,14 @@ function drawArc(SurfaceInterface $surface, $fx, $fy, $coords)
array(),
);

$segsNorm = $this->arcToSegments($tx - $fx, $ty - $fy, $rx, $ry, $large, $sweep, $rot);
$toX = $tx - $fx;
$toY = $ty - $fy;

if ($toX + $toY === 0) {
return;
}

$segsNorm = $this->arcToSegments($toX, $toY, $rx, $ry, $large, $sweep, $rot);

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

0 comments on commit 4498b5d

Please sign in to comment.