mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -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
|
* @return {SVGSVGElement} the item converted to an SVG node
|
||||||
*/
|
*/
|
||||||
exportSVG: function() {
|
exportSVG: function() {
|
||||||
var node = exportSVG(this);
|
return exportDefinitions(exportSVG(this));
|
||||||
return exportDefinitions(node);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -508,20 +507,20 @@ new function() {
|
||||||
* @return {SVGSVGElement} the project converted to an SVG node
|
* @return {SVGSVGElement} the project converted to an SVG node
|
||||||
*/
|
*/
|
||||||
exportSVG: function() {
|
exportSVG: function() {
|
||||||
var node = createElement('svg'),
|
var layers = this.layers,
|
||||||
layers = this.layers,
|
size = this.view.getSize(),
|
||||||
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++)
|
for (var i = 0, l = layers.length; i < l; i++)
|
||||||
node.appendChild(exportSVG(layers[i]));
|
node.appendChild(exportSVG(layers[i]));
|
||||||
return setAttributes(exportDefinitions(node), {
|
return 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'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue