From 1cb6a7fc3c3e0133661f0a0cdfb891716c57b5e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 6 Nov 2012 20:18:59 -0800 Subject: [PATCH] Clean up Path#smooth() code a bit. --- src/path/Path.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/path/Path.js b/src/path/Path.js index 7ebcbe8b..c2a535ff 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -1615,13 +1615,14 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{ // Do the actual averaging simply by linearly fading between the // overlapping values. for (var i = 0, j = size; i < overlap; i++, j++) { - var f1 = (i / overlap); - var f2 = 1 - f1; + var f1 = i / overlap, + f2 = 1 - f1, + ie = i + overlap, + je = j + overlap; // Beginning x[j] = x[i] * f1 + x[j] * f2; y[j] = y[i] * f1 + y[j] * f2; // End - var ie = i + overlap, je = j + overlap; x[je] = x[ie] * f2 + x[je] * f1; y[je] = y[ie] * f2 + y[je] * f1; }