Shorten importGradient() code.

This commit is contained in:
Jürg Lehni 2012-11-08 15:08:06 -08:00
parent 203c9b16ca
commit e6913e0013

View file

@ -207,11 +207,8 @@ new function() {
stops = [];
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i];
if (node.nodeType == 1) {
var stop = new GradientStop();
applyAttributes(stop, node);
stops.push(stop);
}
if (node.nodeType == 1)
stops.push(applyAttributes(new GradientStop(), node));
}
var gradient = new Gradient(stops),
isRadial = type == 'radialgradient',