mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -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;
|
var stops = gradient._stops;
|
||||||
for (var i = 0, l = stops.length; i < l; i++) {
|
for (var i = 0, l = stops.length; i < l; i++) {
|
||||||
var stop = stops[i],
|
var stop = stops[i],
|
||||||
color = stop._color;
|
stopColor = stop._color;
|
||||||
attrs = {
|
attrs = {
|
||||||
offset: stop._rampPoint,
|
offset: stop._rampPoint,
|
||||||
'stop-color': color.toCss(true)
|
'stop-color': stopColor.toCss(true)
|
||||||
};
|
};
|
||||||
// See applyStyle for an explanation of why there are separated
|
// See applyStyle for an explanation of why there are separated
|
||||||
// opacity / color attributes.
|
// opacity / color attributes.
|
||||||
if (color.getAlpha() < 1)
|
if (stopColor.getAlpha() < 1)
|
||||||
attrs['stop-opacity'] = color._alpha;
|
attrs['stop-opacity'] = stopColor._alpha;
|
||||||
gradientNode.appendChild(createElement('stop', attrs));
|
gradientNode.appendChild(createElement('stop', attrs));
|
||||||
}
|
}
|
||||||
setDefinition(gradient, gradientNode);
|
setDefinition(color, gradientNode);
|
||||||
}
|
}
|
||||||
return 'url(#' + gradientNode.id + ')';
|
return 'url(#' + gradientNode.id + ')';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue