diff options
author | jaseg <git@jaseg.de> | 2022-06-10 00:39:07 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2022-06-10 00:39:07 +0200 |
commit | 460ea625af5c1d9e243feaa49923f7b2c7db8837 (patch) | |
tree | 3d7e71e3015d0dd70c7d5f8478448a5cdd369d30 /gerbonara/utils.py | |
parent | e422243a6e76d0b798ae8f175a717c193be4d22a (diff) | |
download | gerbonara-460ea625af5c1d9e243feaa49923f7b2c7db8837.tar.gz gerbonara-460ea625af5c1d9e243feaa49923f7b2c7db8837.tar.bz2 gerbonara-460ea625af5c1d9e243feaa49923f7b2c7db8837.zip |
Fix merging, bounding boxes and svg precision
Diffstat (limited to 'gerbonara/utils.py')
-rw-r--r-- | gerbonara/utils.py | 8 |
1 files changed, 5 insertions, 3 deletions
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) |