summaryrefslogtreecommitdiff
path: root/gerber/cam.py
diff options
context:
space:
mode:
Diffstat (limited to 'gerber/cam.py')
-rw-r--r--gerber/cam.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/gerber/cam.py b/gerber/cam.py
index c567055..cf06ec9 100644
--- a/gerber/cam.py
+++ b/gerber/cam.py
@@ -243,7 +243,7 @@ class CamFile(object):
"""
pass
- def render(self, ctx, filename=None):
+ def render(self, ctx, invert=False, filename=None):
""" Generate image of layer.
Parameters
@@ -256,10 +256,14 @@ class CamFile(object):
"""
ctx.set_bounds(self.bounds)
ctx._paint_background()
- if ctx.invert:
+ if invert:
+ ctx.invert = True
ctx._paint_inverted_layer()
-
for p in self.primitives:
ctx.render(p)
+ if invert:
+ ctx.invert = False
+ ctx._render_mask()
+
if filename is not None:
ctx.dump(filename)