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,9 +304,10 @@ 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'
: entry.type === 'color'
? value.toCssString() ? value.toCssString()
: entry.type === 'array' : entry.type === 'array'
? value.join(',') ? value.join(',')