summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gerber/cam.py4
-rw-r--r--gerber/render/cairo_backend.py6
2 files changed, 8 insertions, 2 deletions
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 <optional>
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:
diff --git a/gerber/render/cairo_backend.py b/gerber/render/cairo_backend.py
index 939863b..16638f5 100644
--- a/gerber/render/cairo_backend.py
+++ b/gerber/render/cairo_backend.py
@@ -72,7 +72,7 @@ class GerberCairoContext(GerberContext):
center = map(mul, arc.center, self.scale)
start = map(mul, arc.start, self.scale)
end = map(mul, arc.end, self.scale)
- radius = self.scale * arc.radius
+ radius = self.scale[0] * arc.radius
angle1 = arc.start_angle
angle2 = arc.end_angle
width = arc.aperture.diameter if arc.aperture.diameter != 0 else 0.001
@@ -139,6 +139,10 @@ class GerberCairoContext(GerberContext):
self.ctx.paint()
self.ctx.set_operator(cairo.OPERATOR_CLEAR)
+ def _paint_background(self):
+ self.ctx.set_source_rgba(*self.background_color)
+ self.ctx.paint()
+
def dump(self, filename):
is_svg = filename.lower().endswith(".svg")