mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -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
|
||||
// (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;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue