From 5225d3da8bdd4ed2b33e43692a4e1a340eb4989b Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 13 Jun 2021 22:17:39 +0200 Subject: Add comment on AM hole handling in cairo backend --- gerbonara/gerber/render/cairo_backend.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gerbonara/gerber') 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) -- cgit