From e1931f066f9df22f365adba0c61fcf4cd7de182c Mon Sep 17 00:00:00 2001 From: Sebastian Hoogen Date: Tue, 28 Jan 2014 20:33:55 +0100 Subject: [PATCH] Draft SVG export: fix viewbox for raw output --- src/Mod/Draft/importSVG.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Draft/importSVG.py b/src/Mod/Draft/importSVG.py index b744670e0..d8b99f3ba 100644 --- a/src/Mod/Draft/importSVG.py +++ b/src/Mod/Draft/importSVG.py @@ -1168,10 +1168,10 @@ def export(exportList,filename): # translated-style exports have the viewbox starting at X=0, Y=0 svg.write(' viewBox="0 0 ' + str(sizex) + ' ' + str(sizey) + '"') else: - # raw-style exports have the viewbox starting at X=0, Y=-height + # raw-style exports have the viewbox starting at X=xmin, Y=-ymax # we need the funny Y here because SVG is upside down, and we # flip the sketch right-way up with a scale later - svg.write(' viewBox="0 ' + str(sizey * -1.0) + ' ' + str(sizex) + ' ' + str(sizey) + '"') + svg.write(' viewBox="%f %f %f %f"' %(minx,-maxy,sizex,sizey)) svg.write(' xmlns="http://www.w3.org/2000/svg" version="1.1"') svg.write('>\n')