Fix issues with SVG gradient export.

This commit is contained in:
Jürg Lehni 2013-02-12 17:05:54 -08:00
parent e9fef8a53c
commit f554bdce2a

View file

@ -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 + ')';
} }