mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -05:00
Handle allowNull correctly again in SVGImport.
This commit is contained in:
parent
a4e875cf29
commit
2b4dddbb1f
1 changed files with 14 additions and 6 deletions
|
@ -24,12 +24,20 @@ new function() {
|
||||||
value = namespace
|
value = namespace
|
||||||
? node.getAttributeNS(namespace, name)
|
? node.getAttributeNS(namespace, name)
|
||||||
: node.getAttribute(name);
|
: node.getAttribute(name);
|
||||||
return isString
|
if (value == 'null')
|
||||||
? value
|
value = null;
|
||||||
// Interpret value as number. Never return NaN, but 0 instead.
|
// Interpret value as number. Never return NaN, but 0 instead.
|
||||||
// If the value is a sequence of numbers, parseFloat will
|
// If the value is a sequence of numbers, parseFloat will
|
||||||
// return the first occuring number, which is enough for now.
|
// return the first occuring number, which is enough for now.
|
||||||
: value == 'null' ? 0 : parseFloat(value);
|
return value == null
|
||||||
|
? allowNull
|
||||||
|
? null
|
||||||
|
: isString
|
||||||
|
? ''
|
||||||
|
: 0
|
||||||
|
: isString
|
||||||
|
? value
|
||||||
|
: parseFloat(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPoint(node, x, y, allowNull) {
|
function getPoint(node, x, y, allowNull) {
|
||||||
|
|
Loading…
Reference in a new issue