protoserve: Fix error with empty layouts
This commit is contained in:
parent
176252b564
commit
e4a459368c
1 changed files with 2 additions and 2 deletions
|
|
@ -74,9 +74,9 @@ class PropLayout:
|
|||
widths.append(x_max - x_min)
|
||||
heights.append(y_max - y_min)
|
||||
if self.direction == 'h':
|
||||
return sum(widths), max(heights)
|
||||
return sum(widths), max(heights, default=0)
|
||||
else:
|
||||
return max(widths), sum(heights)
|
||||
return max(widths, default=0), sum(heights)
|
||||
|
||||
def layout_2d(self, bbox, unit=MM):
|
||||
(x, y), (w, h) = bbox
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue