From 0e46722c154726a5f9ac218197ccc28adba16fcf Mon Sep 17 00:00:00 2001 From: Brian Sweeney Date: Sun, 7 Jan 2024 17:47:36 -0500 Subject: [PATCH] Render a line for a path segment with a radius of zero fixes #97 --- src/Svg/Tag/Path.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Svg/Tag/Path.php b/src/Svg/Tag/Path.php index 3dce7a6..a2a4c5b 100644 --- a/src/Svg/Tag/Path.php +++ b/src/Svg/Tag/Path.php @@ -449,7 +449,12 @@ function drawArc(SurfaceInterface $surface, $fx, $fy, $coords) $toX = $tx - $fx; $toY = $ty - $fy; - if ($toX + $toY === 0) { + if ((float)($toX + $toY) === 0.0) { + return; + } + + if ((float)abs($rx) == 0.0 || (float)abs($ry) === 0.0) { + $surface->lineTo($tx, $ty); return; }