Fix devision by zero for zero lengths

This commit is contained in:
Florian Festi 2018-02-10 20:59:25 +01:00
parent 039fe5f2ee
commit 211e302b41
1 changed files with 4 additions and 1 deletions

View File

@ -463,7 +463,10 @@ class Boxes:
walls += self.thickness
try:
factor = (total - walls) / total
if total > 0.0:
factor = (total - walls) / total
else:
factor = 1.0
return [s * factor for s in l]
except TypeError:
return l - walls