From e4a459368c1befe89c48af1b7721f490df17d001 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sat, 29 Apr 2023 23:17:11 +0200 Subject: protoserve: Fix error with empty layouts --- gerbonara/cad/protoboard.py | 4 ++-- 1 file 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 -- cgit