mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-01 00:29:29 -04:00
Implement a faster method to filter out beginnings of intersected curves.
This commit is contained in:
parent
a9a0857ba4
commit
7f245974e6
2 changed files with 9 additions and 8 deletions
src/path
|
@ -667,11 +667,10 @@ statics: {
|
|||
// See if the parametric equations of the lines interesct.
|
||||
var line1 = new Line(v1[0], v1[1], v1[6], v1[7], false),
|
||||
line2 = new Line(v2[0], v2[1], v2[6], v2[7], false),
|
||||
point = line1.intersect(line2);
|
||||
// Filter out beginnings of the curves, to avoid duplicate
|
||||
// solutions where curves join.
|
||||
if (point && !point.equals(line1.point)
|
||||
&& !point.equals(line2.point))
|
||||
// Filter out beginnings of the curves, to avoid duplicate
|
||||
// solutions where curves join.
|
||||
point = line1.intersect(line2, true, false);
|
||||
if (point)
|
||||
// Passing null for parameter leads to lazy determination of
|
||||
// parameter values in CurveLocation#getParameter() only
|
||||
// once they are requested.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue