summaryrefslogtreecommitdiff
path: root/gerbonara
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-06-13 22:17:39 +0200
committerjaseg <git@jaseg.de>2021-06-13 22:17:39 +0200
commit5225d3da8bdd4ed2b33e43692a4e1a340eb4989b (patch)
treed551d33dd693dacc22b1725f4de0da39ae028a02 /gerbonara
parent66da2d165481d3e0c5c153a788b26aa23cc0ad97 (diff)
downloadgerbonara-5225d3da8bdd4ed2b33e43692a4e1a340eb4989b.tar.gz
gerbonara-5225d3da8bdd4ed2b33e43692a4e1a340eb4989b.tar.bz2
gerbonara-5225d3da8bdd4ed2b33e43692a4e1a340eb4989b.zip
Add comment on AM hole handling in cairo backend
Diffstat (limited to 'gerbonara')
-rw-r--r--gerbonara/gerber/render/cairo_backend.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/gerbonara/gerber/render/cairo_backend.py b/gerbonara/gerber/render/cairo_backend.py
index 6af3348..ff92d99 100644
--- a/gerbonara/gerber/render/cairo_backend.py
+++ b/gerbonara/gerber/render/cairo_backend.py
@@ -513,6 +513,10 @@ class GerberCairoContext(GerberContext):
self.ctx.mask_surface(mask.surface, self.origin_in_pixels[0])
def _render_amgroup(self, amgroup, color):
+ # Since holes/clear areas in the mask group must be drawn as clear, we need to render the primitives of this
+ # group into a mask context first, then composite this mask context on top of our output surface. This means
+ # that a clear primitive inside the group will cover/draw over dark primitives inside the group, but it will
+ # *not* cover/draw over dark primitives outside the group.
mask_surface = cairo.SVGSurface(None, self.size_in_pixels[0], self.size_in_pixels[1])
mask_ctx = cairo.Context(mask_surface)