mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
parent
31498fa6b7
commit
84e1f208fb
1 changed files with 9 additions and 2 deletions
|
@ -192,7 +192,8 @@ PathItem.inject(new function() {
|
|||
* @param {CurveLocation[]} intersections Array of CurveLocation objects
|
||||
*/
|
||||
function splitPath(intersections) {
|
||||
var linearSegments;
|
||||
var TOLERANCE = /*#=*/ Numerical.TOLERANCE,
|
||||
linearSegments;
|
||||
|
||||
function resetLinear() {
|
||||
// Reset linear segments if they were part of a linear curve
|
||||
|
@ -226,7 +227,13 @@ PathItem.inject(new function() {
|
|||
segment = newCurve._segment1;
|
||||
curve = newCurve.getPrevious();
|
||||
} else {
|
||||
segment = t < 0.5 ? curve._segment1 : curve._segment2;
|
||||
segment = t < TOLERANCE
|
||||
? curve._segment1
|
||||
: t > 1 - TOLERANCE
|
||||
? curve._segment2
|
||||
: curve.getPartLength(0, t) < curve.getPartLength(t, 1)
|
||||
? curve._segment1
|
||||
: curve._segment2;
|
||||
}
|
||||
// Link the new segment with the intersection on the other curve
|
||||
segment._intersection = loc.getIntersection();
|
||||
|
|
Loading…
Reference in a new issue