mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 06:00:56 -05:00
Simplify addCurveLineIntersections() code.
This commit is contained in:
parent
8434b4bebe
commit
cae4520665
1 changed files with 5 additions and 7 deletions
|
@ -1395,13 +1395,11 @@ new function() { // Scope for methods that require numerical integration
|
|||
// the line *segment*.
|
||||
if (point.x >= 0 && point.x <= rl2x){
|
||||
// Interpolate for the parameter for the intersection on line
|
||||
var tl = point.x / rl2x;
|
||||
if(flip)
|
||||
addLocation(locations, curve1, tl, Curve.evaluate(vl, tl, 0),
|
||||
curve2, t, Curve.evaluate(vc, t, 0));
|
||||
else
|
||||
addLocation(locations, curve1, t, Curve.evaluate(vc, t, 0),
|
||||
curve2, tl, Curve.evaluate(vl, tl, 0));
|
||||
var tl = point.x / rl2x,
|
||||
t1 = flip ? tl : t,
|
||||
t2 = flip ? t : tl;
|
||||
addLocation(locations, curve1, t1, Curve.evaluate(v1, t1, 0),
|
||||
curve2, t2, Curve.evaluate(v2, t2, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue