From bec1a91812e14839b74e5334cfeb974feea4a504 Mon Sep 17 00:00:00 2001 From: hkrish Date: Tue, 29 Oct 2013 00:10:20 +0100 Subject: [PATCH] Calculate correct parameter for Curve-Line intersections --- src/path/Curve.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/path/Curve.js b/src/path/Curve.js index 935e049d..75a0098a 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -1459,10 +1459,10 @@ new function() { // Scope for methods that require numerical integration var point = Curve.evaluate(vcr, t, 0); // We do have a point on the infinite line. Check if it falls on // the line *segment*. - if (point.x >= 0 && point.x <= rl2x) { + if (point.x >= 0 && point.x <= rl2x){ + var tl = Curve.getParameterOf(vl, point.x, point.y); // Interpolate the parameter for the intersection on line. - var tl = point.x / rl2x, - t1 = flip ? tl : t, + var t1 = flip ? tl : t, t2 = flip ? t : tl; addLocation(locations, curve1, t1, Curve.evaluate(v1, t1, 0),