summaryrefslogtreecommitdiff
path: root/gerber/render/cairo_backend.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2017-06-12 08:02:59 -0400
committerGitHub <noreply@github.com>2017-06-12 08:02:59 -0400
commit8def119980342a7ab977267600cee90d3cfcc412 (patch)
treef1bd8a7035d2b41a29f60e781a01f63146e50e03 /gerber/render/cairo_backend.py
parent872c2db250fe6b82ef893abe8606e08c5fdff2ca (diff)
parente0b45108d2fb96ffcf4e6af02dd55fc6aca3e4b2 (diff)
downloadgerbonara-8def119980342a7ab977267600cee90d3cfcc412.tar.gz
gerbonara-8def119980342a7ab977267600cee90d3cfcc412.tar.bz2
gerbonara-8def119980342a7ab977267600cee90d3cfcc412.zip
Merge pull request #71 from tomacorp/layer_bounds_arg
Added bounds argument to render_layer()
Diffstat (limited to 'gerber/render/cairo_backend.py')
-rw-r--r--gerber/render/cairo_backend.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/gerber/render/cairo_backend.py b/gerber/render/cairo_backend.py
index 3571ed9..0a5e550 100644
--- a/gerber/render/cairo_backend.py
+++ b/gerber/render/cairo_backend.py
@@ -77,7 +77,7 @@ class GerberCairoContext(GerberContext):
self.output_ctx = cairo.Context(self.surface)
def render_layer(self, layer, filename=None, settings=None, bgsettings=None,
- verbose=False):
+ verbose=False, bounds=None):
if settings is None:
settings = THEMES['default'].get(layer.layer_class, RenderSettings())
if bgsettings is None:
@@ -87,7 +87,10 @@ class GerberCairoContext(GerberContext):
if verbose:
print('[Render]: Rendering Background.')
self.clear()
- self.set_bounds(layer.bounds)
+ if bounds is not None:
+ self.set_bounds(bounds)
+ else:
+ self.set_bounds(layer.bounds)
self._paint_background(bgsettings)
if verbose:
print('[Render]: Rendering {} Layer.'.format(layer.layer_class))