mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -05:00
Convert null to 'none' as style values.
This commit is contained in:
parent
5d2b6d613f
commit
88a7fcc92b
1 changed files with 10 additions and 9 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue