diff --git a/src/Renderer/Path/EllipticArc.php b/src/Renderer/Path/EllipticArc.php index ee957d4..800a032 100644 --- a/src/Renderer/Path/EllipticArc.php +++ b/src/Renderer/Path/EllipticArc.php @@ -213,8 +213,10 @@ private function calculateCenterPointParameters(float $fromX, float $fromY, floa $delta = self::angle(($x1p - $cxp) / $rX, ($y1p - $cyp) / $rY, (-$x1p - $cxp) / $rX, (-$y1p - $cyp) / $rY); $delta = fmod($delta, pi() * 2); - if (! $this->sweep) { + if (! $this->sweep && $delta > 0) { $delta -= 2 * pi(); + } elseif ($this->sweep && $delta < 0) { + $delta += 2 * pi(); } return [$cx, $cy, $rX, $rY, $theta, $delta];