mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
SVG Import: Fix namespacing issues introduced by #984
This commit is contained in:
parent
b71e3a44d9
commit
acb1e408d0
1 changed files with 3 additions and 3 deletions
|
@ -18,8 +18,8 @@
|
||||||
var SvgElement = new function() {
|
var SvgElement = new function() {
|
||||||
// SVG related namespaces
|
// SVG related namespaces
|
||||||
var svg = 'http://www.w3.org/2000/svg',
|
var svg = 'http://www.w3.org/2000/svg',
|
||||||
xmlns = 'http://www.w3.org/2000/xmlns/',
|
xmlns = 'http://www.w3.org/2000/xmlns',
|
||||||
xlink = 'http://www.w3.org/1999/xlink/',
|
xlink = 'http://www.w3.org/1999/xlink',
|
||||||
// Mapping of attribute names to required namespaces:
|
// Mapping of attribute names to required namespaces:
|
||||||
attributeNamespace = {
|
attributeNamespace = {
|
||||||
href: xlink,
|
href: xlink,
|
||||||
|
@ -47,7 +47,7 @@ var SvgElement = new function() {
|
||||||
if (typeof value === 'number' && formatter)
|
if (typeof value === 'number' && formatter)
|
||||||
value = formatter.number(value);
|
value = formatter.number(value);
|
||||||
if (namespace) {
|
if (namespace) {
|
||||||
node.setAttributeNS(namespace, name, value);
|
node.setAttributeNS(namespace + '/', name, value);
|
||||||
} else {
|
} else {
|
||||||
node.setAttribute(name, value);
|
node.setAttribute(name, value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue