corner(): Make more robust against division by zero

This commit is contained in:
Florian Festi 2020-02-01 15:03:49 +01:00
parent 2121228036
commit 95f2fbeb82
1 changed files with 2 additions and 2 deletions

View File

@ -650,10 +650,10 @@ class Boxes:
if tabs and self.tabs:
if degrees > 0:
r_ = radius + self.burn
tabrad = self.tabs / r_
tabrad = self.tabs / max(r_, 0.01)
else:
r_ = radius - self.burn
tabrad = -self.tabs / r_
tabrad = -self.tabs / max(r_, 0.01)
length = abs(r_ * rad)
tabs = min(tabs, int(length // (tabs*3*self.tabs)))