Don't try to draw arcs with an zero angle

Thanks to Bruno Ferrarese <https://github.com/bferrarese> for finding and
reporting this issue!
This commit is contained in:
Florian Festi 2020-04-26 17:49:13 +02:00
parent 6440bcb639
commit 3c94b4bf76
1 changed files with 2 additions and 0 deletions

View File

@ -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