mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22: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
|
||||
? node.getAttributeNS(namespace, name)
|
||||
: node.getAttribute(name);
|
||||
return isString
|
||||
? value
|
||||
// Interpret value as number. Never return NaN, but 0 instead.
|
||||
// If the value is a sequence of numbers, parseFloat will
|
||||
// return the first occuring number, which is enough for now.
|
||||
: value == 'null' ? 0 : parseFloat(value);
|
||||
if (value == 'null')
|
||||
value = null;
|
||||
// Interpret value as number. Never return NaN, but 0 instead.
|
||||
// If the value is a sequence of numbers, parseFloat will
|
||||
// return the first occuring number, which is enough for now.
|
||||
return value == null
|
||||
? allowNull
|
||||
? null
|
||||
: isString
|
||||
? ''
|
||||
: 0
|
||||
: isString
|
||||
? value
|
||||
: parseFloat(value);
|
||||
}
|
||||
|
||||
function getPoint(node, x, y, allowNull) {
|
||||
|
|
Loading…
Reference in a new issue