mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Allow for better minification.
This commit is contained in:
parent
f48ef4d1a0
commit
ad034fbb56
1 changed files with 9 additions and 7 deletions
|
@ -417,9 +417,11 @@ new function() {
|
||||||
Base.each(SVGStyles, function(entry) {
|
Base.each(SVGStyles, function(entry) {
|
||||||
// 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 get = entry.get,
|
||||||
if (!parentStyle || !Base.equals(parentStyle[entry.get](), value)) {
|
type = entry.type,
|
||||||
if (entry.type === 'color' && value != null) {
|
value = style[get]();
|
||||||
|
if (!parentStyle || !Base.equals(parentStyle[get](), value)) {
|
||||||
|
if (type === 'color' && value != null) {
|
||||||
// Support for css-style rgba() values is not in SVG 1.1, so
|
// Support for css-style rgba() values is not in SVG 1.1, so
|
||||||
// separate the alpha value of colors with alpha into the
|
// separate the alpha value of colors with alpha into the
|
||||||
// separate fill- / stroke-opacity attribute:
|
// separate fill- / stroke-opacity attribute:
|
||||||
|
@ -429,16 +431,16 @@ new function() {
|
||||||
}
|
}
|
||||||
attrs[entry.attribute] = value == null
|
attrs[entry.attribute] = value == null
|
||||||
? 'none'
|
? 'none'
|
||||||
: entry.type === 'number'
|
: type === 'number'
|
||||||
? formatter.number(value)
|
? formatter.number(value)
|
||||||
: entry.type === 'color'
|
: type === 'color'
|
||||||
? value.gradient
|
? value.gradient
|
||||||
? exportGradient(value, item)
|
? exportGradient(value, item)
|
||||||
// true for noAlpha, see above
|
// true for noAlpha, see above
|
||||||
: value.toCSS(true)
|
: value.toCSS(true)
|
||||||
: entry.type === 'array'
|
: type === 'array'
|
||||||
? value.join(',')
|
? value.join(',')
|
||||||
: entry.type === 'lookup'
|
: type === 'lookup'
|
||||||
? entry.toSVG[value]
|
? entry.toSVG[value]
|
||||||
: value;
|
: value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue