mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-03-13 16:33:28 -04:00
Handle parameter matching of beginning and ends of curves separately.
This commit is contained in:
parent
93ba19f7e2
commit
9e61995282
1 changed files with 8 additions and 0 deletions
|
@ -487,6 +487,14 @@ var Curve = this.Curve = Base.extend(/** @lends Curve# */{
|
|||
},
|
||||
|
||||
getParameter: function(v, x, y) {
|
||||
// Handle beginnings and end seperately, as they are not detected
|
||||
// sometimes.
|
||||
if (Math.abs(v[0] - x) < Numerical.TOLERANCE
|
||||
&& Math.abs(v[1] - y) < Numerical.TOLERANCE)
|
||||
return 0;
|
||||
if (Math.abs(v[6] - x) < Numerical.TOLERANCE
|
||||
&& Math.abs(v[7] - y) < Numerical.TOLERANCE)
|
||||
return 1;
|
||||
var txs = [],
|
||||
tys = [],
|
||||
sx = Curve.solveCubic(v, 0, x, txs),
|
||||
|
|
Loading…
Reference in a new issue