mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Improve handling of tMin and tMax in self-intersection code in PathItem#getIntersections()
This commit is contained in:
parent
f782abd0d7
commit
bdcfb60a9a
1 changed files with 5 additions and 6 deletions
|
@ -111,14 +111,13 @@ var PathItem = Item.extend(/** @lends PathItem# */{
|
|||
}
|
||||
// Check for intersections with other curves
|
||||
for (var j = selfOp ? i + 1 : 0; j < length2; j++) {
|
||||
// Avoid end point intersections on consecutive curves whe self
|
||||
// intersecting.
|
||||
var excludeEnds = selfOp && (j === i + 1
|
||||
|| (j === length2 - 1 && i === 0));
|
||||
Curve.getIntersections(values1, values2[j], curve1,
|
||||
curves2[j], locations,
|
||||
excludeEnds ? ZERO : 0, // tMin
|
||||
excludeEnds ? ONE : 1); // tMax
|
||||
// Avoid end point intersections on consecutive curves
|
||||
// when self intersecting.
|
||||
selfOp && (j === i + 1 || j === length2 - 1 && i === 0)
|
||||
? ZERO : 0, // tMin
|
||||
ONE); // tMax
|
||||
}
|
||||
}
|
||||
// Now filter the locations and process _expand:
|
||||
|
|
Loading…
Reference in a new issue