From 491250ef14846d1439802f25a13a46f01eab17be Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Tue, 12 Apr 2011 14:20:56 +0200 Subject: [PATCH] Simplify Path.Star constructor. --- src/path/Path.Constructors.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/path/Path.Constructors.js b/src/path/Path.Constructors.js index 6bb12e65..58537fd4 100644 --- a/src/path/Path.Constructors.js +++ b/src/path/Path.Constructors.js @@ -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;