From 2c887a417561c5f7f86a13afadf70fbc225a776e Mon Sep 17 00:00:00 2001 From: Thomas Ritou Date: Tue, 1 Jan 2013 19:15:19 +1100 Subject: [PATCH] Improve handling of filled curvedLines No more holes is the curve when there is not the amount of points in top and bottom curved line. --- curvedLines.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/curvedLines.js b/curvedLines.js index 517dcb5..7612702 100644 --- a/curvedLines.js +++ b/curvedLines.js @@ -134,11 +134,11 @@ } else if (pointsTop[i] < pointsBottom[j]) { datapoints.points[k] = pointsTop[i]; datapoints.points[k + 1] = pointsTop[i + 1]; - datapoints.points[k + 2] = null; + datapoints.points[k + 2] = k > 0 ? datapoints.points[k-1] : null; i += ps; } else { datapoints.points[k] = pointsBottom[j]; - datapoints.points[k + 1] = null; + datapoints.points[k + 1] = k > 1 ? datapoints.points[k-2] : null; datapoints.points[k + 2] = pointsBottom[j + 1]; j += ps; }