summaryrefslogtreecommitdiff
path: root/gerber/render/svgwrite_backend.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2014-10-12 12:38:40 -0400
committerHamilton Kibbe <hamilton.kibbe@gmail.com>2014-10-12 12:38:40 -0400
commit8c5c7ec8bbc8a074884ef04b566f9c0ecd6e78bb (patch)
treea9032538e4a96f11a9ec16d1c761f4d8862529a8 /gerber/render/svgwrite_backend.py
parentd9018da412470053a063b7b28b5e32529fc573f6 (diff)
downloadgerbonara-8c5c7ec8bbc8a074884ef04b566f9c0ecd6e78bb.tar.gz
gerbonara-8c5c7ec8bbc8a074884ef04b566f9c0ecd6e78bb.tar.bz2
gerbonara-8c5c7ec8bbc8a074884ef04b566f9c0ecd6e78bb.zip
update docs and example images
Diffstat (limited to 'gerber/render/svgwrite_backend.py')
-rw-r--r--gerber/render/svgwrite_backend.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/gerber/render/svgwrite_backend.py b/gerber/render/svgwrite_backend.py
index 886b4f8..78961da 100644
--- a/gerber/render/svgwrite_backend.py
+++ b/gerber/render/svgwrite_backend.py
@@ -117,6 +117,7 @@ class GerberSvgContext(GerberContext):
self.apertures = {}
self.dwg = svgwrite.Drawing()
+ self.dwg.transform = 'scale 1 -1'
self.background = False
self.region_path = None
@@ -124,11 +125,17 @@ class GerberSvgContext(GerberContext):
xbounds, ybounds = bounds
size = (SCALE * (xbounds[1] - xbounds[0]), SCALE * (ybounds[1] - ybounds[0]))
if not self.background:
+ self.dwg = svgwrite.Drawing(viewBox='%f, %f, %f, %f' % (SCALE*xbounds[0], -SCALE*ybounds[1],size[0], size[1]))
self.dwg.add(self.dwg.rect(insert=(SCALE * xbounds[0],
-SCALE * ybounds[1]),
size=size, fill=convert_color(self.background_color)))
self.background = True
+ def set_alpha(self, alpha):
+ super(GerberSvgContext, self).set_alpha(alpha)
+ import warnings
+ warnings.warn('SVG output does not support transparency')
+
def define_aperture(self, d, shape, modifiers):
aperture = None
if shape == 'C':