diff options
author | Tom Anderson <tomacorp@gmail.com> | 2017-05-24 09:42:23 -0700 |
---|---|---|
committer | Tom Anderson <tomacorp@gmail.com> | 2017-05-24 09:42:23 -0700 |
commit | e0b45108d2fb96ffcf4e6af02dd55fc6aca3e4b2 (patch) | |
tree | 4ec45ba8f52f4d7abab4d6baae7c2e0c3cd40e4e | |
parent | a5aa8bc9baa93db1313820b79272cb4900e341b8 (diff) | |
download | gerbonara-e0b45108d2fb96ffcf4e6af02dd55fc6aca3e4b2.tar.gz gerbonara-e0b45108d2fb96ffcf4e6af02dd55fc6aca3e4b2.tar.bz2 gerbonara-e0b45108d2fb96ffcf4e6af02dd55fc6aca3e4b2.zip |
Added bounds argument to render_layer()
-rw-r--r-- | gerber/render/cairo_backend.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gerber/render/cairo_backend.py b/gerber/render/cairo_backend.py index 76be60a..3d87f5c 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)) |