Convert null to 'none' as style values.

This commit is contained in:
Jürg Lehni 2012-11-06 08:22:22 -08:00
parent 5d2b6d613f
commit 88a7fcc92b

View file

@ -304,15 +304,16 @@ var SvgExporter = this.SvgExporter = new function() {
// Get a given style only if it differs from the value on the parent // Get a given style only if it differs from the value on the parent
// (A layer or group which can have style values in SVG). // (A layer or group which can have style values in SVG).
var value = style[entry.get](); var value = style[entry.get]();
if (value != null && (!parentStyle if (!parentStyle || !Base.equals(parentStyle[entry.get](), value)) {
|| !Base.equals(parentStyle[entry.get](), value))) { attrs[entry.attribute] = value == null
attrs[entry.attribute] = entry.type === 'color' ? 'none'
? value.toCssString() : entry.type === 'color'
: entry.type === 'array' ? value.toCssString()
? value.join(',') : entry.type === 'array'
: entry.type === 'number' ? value.join(',')
? formatNumber(value) : entry.type === 'number'
: value; ? formatNumber(value)
: value;
} }
}); });