mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Clean up export code.
This commit is contained in:
parent
a1cab3592b
commit
470cfae9f1
1 changed files with 13 additions and 14 deletions
|
@ -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);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue