From c40aa647342b6d7ba7423d97381ae108113b101f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Wobst?= Date: Thu, 30 Apr 2015 11:49:06 +0000 Subject: [PATCH] add origin and svg version git-svn-id: http://svn.code.sf.net/p/pyx/code/trunk/pyx@3636 a4f5e268-e194-4f32-bce1-d30804cbbcc5 --- pyx/svgwriter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyx/svgwriter.py b/pyx/svgwriter.py index d9a9bac7..45862672 100644 --- a/pyx/svgwriter.py +++ b/pyx/svgwriter.py @@ -204,7 +204,7 @@ class SVGwriter: x = SVGGenerator(file, xlink=pagesvg.xlink_used) x.startSVGDocument() - attrs = {"fill": "none"} + attrs = {"fill": "none", "version": "1.1"} if pagebbox: # note that svg uses an inverse y coordinate; to compansate this # PyX writes negative y coordinates and the viewbox needs to be @@ -212,6 +212,8 @@ class SVGwriter: # a text remains upright). llx, lly, urx, ury = pagebbox.highrestuple_pt() attrs["viewBox"] = "%g %g %g %g" % (llx, -ury, urx-llx, ury-lly) + attrs["x"] = "%gpt" % llx + attrs["y"] = "%gpt" % -ury attrs["width"] = "%gpt" % (urx-llx) attrs["height"] = "%gpt" % (ury-lly) style.linewidth.normal.processSVGattrs(attrs, self, acontext, registry) -- 2.11.4.GIT