summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorK Henriksson <khenriksson@bgsh.org>2021-02-28 17:29:16 -0800
committerjaseg <git@jaseg.de>2021-06-13 17:14:11 +0200
commitc05abf0d0f1a960a4de2f7c9711f160194a19488 (patch)
treed31320abdf9eeca000e41ca0114f3c91f849381a
parentb5493015c05b93d43488468e1f99448c0cd573d5 (diff)
downloadgerbonara-c05abf0d0f1a960a4de2f7c9711f160194a19488.tar.gz
gerbonara-c05abf0d0f1a960a4de2f7c9711f160194a19488.tar.bz2
gerbonara-c05abf0d0f1a960a4de2f7c9711f160194a19488.zip
Fix math error in clipping code
ymax should be the ceil of the argument, not the floor.
-rw-r--r--gerbonara/gerber/render/cairo_backend.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gerbonara/gerber/render/cairo_backend.py b/gerbonara/gerber/render/cairo_backend.py
index cb2f37c..d9c197d 100644
--- a/gerbonara/gerber/render/cairo_backend.py
+++ b/gerbonara/gerber/render/cairo_backend.py
@@ -596,7 +596,7 @@ class GerberCairoContext(GerberContext):
# caused by flipping the axis.
clp.ymin = math.floor(
(self.scale[1] * ymin) - math.ceil(self.origin_in_pixels[1]))
- clp.ymax = math.floor(
+ clp.ymax = math.ceil(
(self.scale[1] * ymax) - math.floor(self.origin_in_pixels[1]))
# Calculate width and height, rounded to the nearest pixel