From c05abf0d0f1a960a4de2f7c9711f160194a19488 Mon Sep 17 00:00:00 2001 From: K Henriksson Date: Sun, 28 Feb 2021 17:29:16 -0800 Subject: Fix math error in clipping code ymax should be the ceil of the argument, not the floor. --- gerbonara/gerber/render/cairo_backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gerbonara/gerber/render') 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 -- cgit