mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Consistently return curve parameter on Line intersections as well, so that sorting intersections wouldn't fail.
This commit is contained in:
parent
20fbdcffda
commit
20b6d699db
1 changed files with 7 additions and 4 deletions
|
@ -1444,10 +1444,13 @@ new function() { // Scope for methods that require numerical integration
|
||||||
var point = Line.intersect(
|
var point = Line.intersect(
|
||||||
v1[0], v1[1], v1[6], v1[7],
|
v1[0], v1[1], v1[6], v1[7],
|
||||||
v2[0], v2[1], v2[6], v2[7]);
|
v2[0], v2[1], v2[6], v2[7]);
|
||||||
// Passing null for parameter leads to lazy determination of parameter
|
if (point){
|
||||||
// values in CurveLocation#getParameter() only once they are requested.
|
// We need to return the parameters for the intersection,
|
||||||
if (point)
|
// since they will be used for sorting
|
||||||
addLocation(locations, curve1, null, point, curve2);
|
var t1 = Curve.getParameterOf(v1, point.x, point.y),
|
||||||
|
t2 = Curve.getParameterOf(v2, point.x, point.y);
|
||||||
|
addLocation(locations, curve1, t1, point, curve2, t2, point);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return { statics: /** @lends Curve */{
|
return { statics: /** @lends Curve */{
|
||||||
|
|
Loading…
Reference in a new issue