Simplify Path.Star constructor.

This commit is contained in:
Jonathan Puckey 2011-04-12 14:20:56 +02:00
parent 12de77eb42
commit 491250ef14

View file

@ -136,12 +136,10 @@ Path.inject({ statics: new function() {
outerFirst = radius1 < radius2,
path = new Path();
for (var i = 0; i < numPoints; i++) {
var radius = i % 2 == outerFirst ? outer : inner,
vector = new Point({
angle: -90 + angle * i,
length: radius
});
path.add(center.add(vector));
path.add(center.add({
angle: -90 + angle * i,
length: i % 2 == outerFirst ? outer : inner
}));
}
path.closed = true;
return path;