From c94fb3038f3003cbfeca37da7c5a0d445f386e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 20 Sep 2014 11:08:20 +0200 Subject: [PATCH] Use valid parameter range [0,1] in calls to Curve.solveCubic(). --- src/path/Curve.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/path/Curve.js b/src/path/Curve.js index 2572cb6f..430b0754 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -485,6 +485,7 @@ statics: { return values; }, + // TODO: Instead of constants for type, use a "enum" and code substitution. evaluate: function(v, t, type) { var p1x = v[0], p1y = v[1], c1x = v[2], c1y = v[3], @@ -595,8 +596,8 @@ statics: { return 1; var txs = [], tys = [], - sx = Curve.solveCubic(v, 0, x, txs), - sy = Curve.solveCubic(v, 1, y, tys), + sx = Curve.solveCubic(v, 0, x, txs, 0, 1), + sy = Curve.solveCubic(v, 1, y, tys, 0, 1), tx, ty; // sx, sy == -1 means infinite solutions: // Loop through all solutions for x and match with solutions for y,