From 057b71ff4c452afe58dde5dd782775fa0fc52efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 15 May 2011 14:29:00 +0100 Subject: [PATCH] Don't overuse variable chaining - use only were readibility does not suffer. --- src/path/Path.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/path/Path.js b/src/path/Path.js index e97f2411..330d0058 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -855,20 +855,20 @@ var Path = this.Path = PathItem.extend({ inc = Math.min(Math.max(extent, -d180), d180) / arcSegs, z = 4 / 3 * Math.sin(inc / 2) / (1 + Math.cos(inc / 2)), segments = []; - // TODO: Use Point#setAngle() and Point vector algebra instead. + // TODO: Use Point#setAngle() and Point vector algebra instead? for (var i = 0; i <= arcSegs; i++) { var relx = Math.cos(angle), - rely = Math.sin(angle), - pt = new Point( - cx + relx * radius, - cy + rely * radius - ), - out = i == arcSegs - ? null - : new Point( - cx + (relx - z * rely) * radius - pt.x, - cy + (rely + z * relx) * radius - pt.y - ); + rely = Math.sin(angle); + var pt = new Point( + cx + relx * radius, + cy + rely * radius + ); + var out = i == arcSegs + ? null + : new Point( + cx + (relx - z * rely) * radius - pt.x, + cy + (rely + z * relx) * radius - pt.y + ); if (i == 0) { // Modify startSegment current.setHandleOut(out);