From 5aaf18889c3cdc31ae61b9593bf5848bc57ec09a Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Thu, 9 Jul 2015 03:54:47 -0300 Subject: Initial patch to unify our render towards cairo This branch allows a pure cairo based render for both PNG and SVG. Cairo backend is mostly the same but with improved support for configurable scale, orientation and inverted color drawing. API is not yet final. --- gerber/cam.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gerber/cam.py') diff --git a/gerber/cam.py b/gerber/cam.py index 31b6d2f..91ffb9a 100644 --- a/gerber/cam.py +++ b/gerber/cam.py @@ -253,8 +253,9 @@ class CamFile(object): filename : string If provided, save the rendered image to `filename` """ - bounds = [tuple([x * 1.2, y*1.2]) for x, y in self.bounds] - ctx.set_bounds(bounds) + if ctx.invert: + ctx._paint_inverted_layer() + for p in self.primitives: ctx.render(p) if filename is not None: -- cgit From b3f6ec558ca35a19bd60440f2a114eb98c0a4263 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Thu, 9 Jul 2015 04:05:15 -0300 Subject: Fix arcs and ackground painting --- gerber/cam.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gerber/cam.py') diff --git a/gerber/cam.py b/gerber/cam.py index 91ffb9a..804e366 100644 --- a/gerber/cam.py +++ b/gerber/cam.py @@ -253,9 +253,11 @@ class CamFile(object): filename : string If provided, save the rendered image to `filename` """ + ctx._paint_background() + if ctx.invert: ctx._paint_inverted_layer() - + for p in self.primitives: ctx.render(p) if filename is not None: -- cgit From 39726e3936c5fa5c50158727e8eb7f5d01cb1b49 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Wed, 22 Jul 2015 22:13:09 -0400 Subject: Fix multiple layer issue in cairo-unification branch (see #33) --- gerber/cam.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gerber/cam.py') diff --git a/gerber/cam.py b/gerber/cam.py index 804e366..0a68b23 100644 --- a/gerber/cam.py +++ b/gerber/cam.py @@ -253,8 +253,8 @@ class CamFile(object): filename : string If provided, save the rendered image to `filename` """ + ctx.set_bounds(self.bounds) ctx._paint_background() - if ctx.invert: ctx._paint_inverted_layer() -- cgit