PaintStorage: Prevent division by zero

This commit is contained in:
Florian Festi 2020-02-01 14:31:24 +01:00
parent dd0f2d748c
commit 2a7e1e62d1
1 changed files with 4 additions and 0 deletions

View File

@ -54,6 +54,10 @@ class PaintStorage(Boxes):
return
n_x = int(self.x / (self.candiameter+self.minspace))
n_y = int(self.y / (self.candiameter+self.minspace))
if n_x <= 0 or n_y <= 0:
return
spacing_x = (self.x - n_x*self.candiameter)/n_x
spacing_y = (self.y - n_y*self.candiameter)/n_y
for i in range(n_y):