From 460ea625af5c1d9e243feaa49923f7b2c7db8837 Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 10 Jun 2022 00:39:07 +0200 Subject: Fix merging, bounding boxes and svg precision --- gerbonara/utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gerbonara/utils.py') diff --git a/gerbonara/utils.py b/gerbonara/utils.py index 38fa57e..290a44a 100644 --- a/gerbonara/utils.py +++ b/gerbonara/utils.py @@ -269,10 +269,12 @@ def sum_bounds(bounds, *, default=None): :rtype: tuple """ - if not bounds: - return default + bounds = iter(bounds) - ((min_x, min_y), (max_x, max_y)), *bounds = bounds + for (min_x, min_y), (max_x, max_y) in bounds: + break + else: + return default for (min_x_2, min_y_2), (max_x_2, max_y_2) in bounds: min_x, min_y = min_none(min_x, min_x_2), min_none(min_y, min_y_2) -- cgit