Handle allowNull correctly again in SVGImport.

This commit is contained in:
Jürg Lehni 2013-05-09 16:16:48 -07:00
parent a4e875cf29
commit 2b4dddbb1f

View file

@ -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) {