mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Merge branch 'refs/heads/intersect-fix'
Conflicts: src/path/Curve.js
This commit is contained in:
commit
ef972949c8
1 changed files with 3 additions and 2 deletions
|
@ -1455,11 +1455,12 @@ new function() { // Scope for methods that require numerical integration
|
|||
// happen with lines, in which case we should not be here.
|
||||
for (var i = 0; i < count; i++) {
|
||||
var tc = roots[i],
|
||||
point = Curve.evaluate(vc, tc, 0),
|
||||
point = Curve.evaluate(vcr, tc, 0),
|
||||
tl = Curve.getParameterOf(vl, point.x, point.y);
|
||||
// We do have a point on the infinite line. Check if it falls on
|
||||
// the line *segment*.
|
||||
if (tl >= 0 && tl <= 1) {
|
||||
if (point.x >= 0 && point.x <= rl2x){
|
||||
var tl = Curve.getParameterOf([0, 0, 0, 0, rl2x, 0, rl2x, 0], point.x, 0);
|
||||
// Interpolate the parameter for the intersection on line.
|
||||
var t1 = flip ? tl : tc,
|
||||
t2 = flip ? tc : tl;
|
||||
|
|
Loading…
Reference in a new issue