summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-04-29 23:17:11 +0200
committerjaseg <git@jaseg.de>2023-04-29 23:17:11 +0200
commite4a459368c1befe89c48af1b7721f490df17d001 (patch)
tree274cb4fdd4dd7fb8a661719fe00ea111b70ad5b0
parent176252b564deb168a6c7823ce313aa0d7bba9095 (diff)
downloadgerbonara-e4a459368c1befe89c48af1b7721f490df17d001.tar.gz
gerbonara-e4a459368c1befe89c48af1b7721f490df17d001.tar.bz2
gerbonara-e4a459368c1befe89c48af1b7721f490df17d001.zip
protoserve: Fix error with empty layouts
-rw-r--r--gerbonara/cad/protoboard.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gerbonara/cad/protoboard.py b/gerbonara/cad/protoboard.py
index af61085..bc759f8 100644
--- a/gerbonara/cad/protoboard.py
+++ b/gerbonara/cad/protoboard.py
@@ -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