mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-03-13 16:33:28 -04:00
Add comments to Curve#getParameterOf()
This commit is contained in:
parent
bbc0029252
commit
588ddbe011
1 changed files with 3 additions and 0 deletions
|
@ -678,6 +678,9 @@ statics: {
|
|||
return t;
|
||||
}
|
||||
}
|
||||
// For very short curves (length ~ 1e-13), the above code will not
|
||||
// necessarily produce any valid roots. As a fall-back, just check the
|
||||
// beginnings and ends at the end so we can still return a valid result.
|
||||
return point.isClose(new Point(v[0], v[1]), epsilon) ? 0
|
||||
: point.isClose(new Point(v[6], v[7]), epsilon) ? 1
|
||||
: null;
|
||||
|
|
Loading…
Reference in a new issue