From 3c94b4bf76e913ea8c7fabf0aa968f9247a8acd5 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Sun, 26 Apr 2020 17:49:13 +0200 Subject: [PATCH] Don't try to draw arcs with an zero angle Thanks to Bruno Ferrarese for finding and reporting this issue! --- boxes/drawing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boxes/drawing.py b/boxes/drawing.py index d21d73a..a0696a7 100644 --- a/boxes/drawing.py +++ b/boxes/drawing.py @@ -265,6 +265,8 @@ class Context: self._line_to(x, y) def _arc(self, xc, yc, radius, angle1, angle2, direction): + if abs(angle1 - angle2) < EPS or radius < EPS: + return x1, y1 = radius * math.cos(angle1) + xc, radius * math.sin(angle1) + yc x4, y4 = radius * math.cos(angle2) + xc, radius * math.sin(angle2) + yc