Skip to content

Commit cae4520

Browse files
committed
Simplify addCurveLineIntersections() code.
1 parent 8434b4b commit cae4520

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/path/Curve.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,13 +1395,11 @@ new function() { // Scope for methods that require numerical integration
13951395
// the line *segment*.
13961396
if (point.x >= 0 && point.x <= rl2x){
13971397
// Interpolate for the parameter for the intersection on line
1398-
var tl = point.x / rl2x;
1399-
if(flip)
1400-
addLocation(locations, curve1, tl, Curve.evaluate(vl, tl, 0),
1401-
curve2, t, Curve.evaluate(vc, t, 0));
1402-
else
1403-
addLocation(locations, curve1, t, Curve.evaluate(vc, t, 0),
1404-
curve2, tl, Curve.evaluate(vl, tl, 0));
1398+
var tl = point.x / rl2x,
1399+
t1 = flip ? tl : t,
1400+
t2 = flip ? t : tl;
1401+
addLocation(locations, curve1, t1, Curve.evaluate(v1, t1, 0),
1402+
curve2, t2, Curve.evaluate(v2, t2, 0));
14051403
}
14061404
}
14071405
}

0 commit comments

Comments
 (0)