mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Fix issues with SVG gradient export.
This commit is contained in:
parent
e9fef8a53c
commit
f554bdce2a
1 changed files with 5 additions and 5 deletions
|
@ -415,18 +415,18 @@ new function() {
|
|||
var stops = gradient._stops;
|
||||
for (var i = 0, l = stops.length; i < l; i++) {
|
||||
var stop = stops[i],
|
||||
color = stop._color;
|
||||
stopColor = stop._color;
|
||||
attrs = {
|
||||
offset: stop._rampPoint,
|
||||
'stop-color': color.toCss(true)
|
||||
'stop-color': stopColor.toCss(true)
|
||||
};
|
||||
// See applyStyle for an explanation of why there are separated
|
||||
// opacity / color attributes.
|
||||
if (color.getAlpha() < 1)
|
||||
attrs['stop-opacity'] = color._alpha;
|
||||
if (stopColor.getAlpha() < 1)
|
||||
attrs['stop-opacity'] = stopColor._alpha;
|
||||
gradientNode.appendChild(createElement('stop', attrs));
|
||||
}
|
||||
setDefinition(gradient, gradientNode);
|
||||
setDefinition(color, gradientNode);
|
||||
}
|
||||
return 'url(#' + gradientNode.id + ')';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue