From 470cfae9f1f3d693dacc3cd7a21dc19858f00cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 11 Jun 2013 14:15:54 -0700 Subject: [PATCH] Clean up export code. --- src/svg/SVGExport.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/svg/SVGExport.js b/src/svg/SVGExport.js index e3ca8421..c245ec74 100644 --- a/src/svg/SVGExport.js +++ b/src/svg/SVGExport.js @@ -493,8 +493,7 @@ new function() { * @return {SVGSVGElement} the item converted to an SVG node */ exportSVG: function() { - var node = exportSVG(this); - return exportDefinitions(node); + return exportDefinitions(exportSVG(this)); } }); @@ -508,20 +507,20 @@ new function() { * @return {SVGSVGElement} the project converted to an SVG node */ exportSVG: function() { - var node = createElement('svg'), - layers = this.layers, - size = this.view.getSize(); + var layers = this.layers, + size = this.view.getSize(), + node = createElement('svg', { + x: 0, + y: 0, + width: size.width, + height: size.height, + version: '1.1', + xmlns: 'http://www.w3.org/2000/svg', + xlink: 'http://www.w3.org/1999/xlink' + }); for (var i = 0, l = layers.length; i < l; i++) node.appendChild(exportSVG(layers[i])); - return setAttributes(exportDefinitions(node), { - x: 0, - y: 0, - width: size.width, - height: size.height, - version: '1.1', - xmlns: 'http://www.w3.org/2000/svg', - xlink: 'http://www.w3.org/1999/xlink' - }); + return exportDefinitions(node); } }); };