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
// (A layer or group which can have style values in SVG).
var value = style[entry.get]();
if (value != null && (!parentStyle
|| !Base.equals(parentStyle[entry.get](), value))) {
attrs[entry.attribute] = entry.type === 'color'
? value.toCssString()
: entry.type === 'array'
? value.join(',')
: entry.type === 'number'
? formatNumber(value)
: value;
if (!parentStyle || !Base.equals(parentStyle[entry.get](), value)) {
attrs[entry.attribute] = value == null
? 'none'
: entry.type === 'color'
? value.toCssString()
: entry.type === 'array'
? value.join(',')
: entry.type === 'number'
? formatNumber(value)
: value;
}
});