From 9496ac70bda7c58adb6e0ca06cae5d543d984f1d Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sat, 26 Feb 2011 19:21:52 +0100 Subject: [PATCH] Clean up Path.RegularPolygon constructor. --- src/path/Path.Constructors.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/path/Path.Constructors.js b/src/path/Path.Constructors.js index f0b0e137..44b543fc 100644 --- a/src/path/Path.Constructors.js +++ b/src/path/Path.Constructors.js @@ -109,8 +109,9 @@ Path.inject({ statics: new function() { var path = new Path(); var three = !(numSides % 3); var vector = new Point(0, three ? -radius : radius); + var offset = three ? -1 : 0.5; for(var i = 0; i < numSides; i++) { - var angle = (360 / numSides) * (i + (three ? -1 : 0.5)); + var angle = (360 / numSides) * (i + offset); path.add(center.add(vector.rotate(angle))); } path.closed = true;