From 03d2a3e32bd74c94579f6be0570aaa051293d34e Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Fri, 20 Nov 2009 18:10:59 +0000 Subject: [PATCH] Fixed issue 266 by changing the viewBox to width/height on serialization git-svn-id: http://svg-edit.googlecode.com/svn/trunk@962 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 40133077..ee5eebc3 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -1084,8 +1084,15 @@ function BatchCommand(text) { } }); svgcontent.removeAttribute('id'); + var res = canvas.getResolution(); + assignAttributes(svgcontent, {width: res.w, height: res.h}); + svgcontent.removeAttribute('viewBox'); + var output = svgToString(svgcontent, 0); - svgcontent.id = 'svgcontent'; + + assignAttributes(svgcontent, {id: 'svgcontent', 'viewBox':[0,0,res.w,res.h].join(' ')}); + svgcontent.removeAttribute('width'); + svgcontent.removeAttribute('height'); return output; }