From 20b6d699db8ece0c726c770e1bd7b9c75efe887d Mon Sep 17 00:00:00 2001 From: hkrish Date: Mon, 23 Dec 2013 23:34:26 +0100 Subject: [PATCH] Consistently return curve parameter on Line intersections as well, so that sorting intersections wouldn't fail. --- src/path/Curve.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/path/Curve.js b/src/path/Curve.js index d8e331f5..1e43a6fb 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -1444,10 +1444,13 @@ new function() { // Scope for methods that require numerical integration var point = Line.intersect( v1[0], v1[1], v1[6], v1[7], v2[0], v2[1], v2[6], v2[7]); - // Passing null for parameter leads to lazy determination of parameter - // values in CurveLocation#getParameter() only once they are requested. - if (point) - addLocation(locations, curve1, null, point, curve2); + if (point){ + // We need to return the parameters for the intersection, + // since they will be used for sorting + var t1 = Curve.getParameterOf(v1, point.x, point.y), + t2 = Curve.getParameterOf(v2, point.x, point.y); + addLocation(locations, curve1, t1, point, curve2, t2, point); + } } return { statics: /** @lends Curve */{