mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -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
|
* @param {CurveLocation[]} intersections Array of CurveLocation objects
|
||||||
*/
|
*/
|
||||||
function splitPath(intersections) {
|
function splitPath(intersections) {
|
||||||
var linearSegments;
|
var TOLERANCE = /*#=*/ Numerical.TOLERANCE,
|
||||||
|
linearSegments;
|
||||||
|
|
||||||
function resetLinear() {
|
function resetLinear() {
|
||||||
// Reset linear segments if they were part of a linear curve
|
// Reset linear segments if they were part of a linear curve
|
||||||
|
@ -226,7 +227,13 @@ PathItem.inject(new function() {
|
||||||
segment = newCurve._segment1;
|
segment = newCurve._segment1;
|
||||||
curve = newCurve.getPrevious();
|
curve = newCurve.getPrevious();
|
||||||
} else {
|
} 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
|
// Link the new segment with the intersection on the other curve
|
||||||
segment._intersection = loc.getIntersection();
|
segment._intersection = loc.getIntersection();
|
||||||
|
|
Loading…
Reference in a new issue