mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Calculate correct parameter for Curve-Line intersections
This commit is contained in:
parent
61ecf44140
commit
bec1a91812
1 changed files with 3 additions and 3 deletions
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue