mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-22 07:19:57 -05:00
Give the intersection that brings us back to the beginning alwasy the priority.
This commit is contained in:
parent
c79166a46f
commit
fc0b5a8858
1 changed files with 5 additions and 5 deletions
|
@ -560,7 +560,7 @@ PathItem.inject(new function() {
|
||||||
+ ', seg wi:' + seg._winding
|
+ ', seg wi:' + seg._winding
|
||||||
+ ', next wi:' + next._winding
|
+ ', next wi:' + next._winding
|
||||||
+ ', seg op:' + isValid(seg, true)
|
+ ', seg op:' + isValid(seg, true)
|
||||||
+ ', next op:' + isValid(next)
|
+ ', next op:' + isValid(next, !strict && inter._overlap)
|
||||||
+ ', seg ov: ' + (seg._intersection
|
+ ', seg ov: ' + (seg._intersection
|
||||||
&& seg._intersection._overlap)
|
&& seg._intersection._overlap)
|
||||||
+ ', next ov: ' + (next._intersection
|
+ ', next ov: ' + (next._intersection
|
||||||
|
@ -579,9 +579,9 @@ PathItem.inject(new function() {
|
||||||
// which invalid current segments are tolerated, and overlaps for
|
// which invalid current segments are tolerated, and overlaps for
|
||||||
// the next segment are allowed as long as they are valid when not
|
// the next segment are allowed as long as they are valid when not
|
||||||
// adjusted.
|
// adjusted.
|
||||||
return !seg._visited && (!next._visited
|
return next === start || next === otherStart
|
||||||
|| next === start || next === otherStart)
|
// Self-intersection (!operator) doesn't need isValid() calls
|
||||||
&& (!operator // Self-intersection doesn't need isValid() calls
|
|| !seg._visited && !next._visited && (!operator
|
||||||
// NOTE: We need to use the unadjusted winding here since an
|
// NOTE: We need to use the unadjusted winding here since an
|
||||||
// overlap crossing might have brought us here, in which
|
// overlap crossing might have brought us here, in which
|
||||||
// case isValid(seg, false) might be false.
|
// case isValid(seg, false) might be false.
|
||||||
|
@ -681,7 +681,7 @@ PathItem.inject(new function() {
|
||||||
drawSegment(seg, other, 'overlap-cross', i, 'orange');
|
drawSegment(seg, other, 'overlap-cross', i, 'orange');
|
||||||
seg = other;
|
seg = other;
|
||||||
} else {
|
} else {
|
||||||
drawSegment(seg, null, 'overlap-stay', i, 'orange');
|
drawSegment(seg, other, 'overlap-stay', i, 'orange');
|
||||||
}
|
}
|
||||||
} else if (operation === 'exclude') {
|
} else if (operation === 'exclude') {
|
||||||
// We need to handle exclusion separately, as we want to
|
// We need to handle exclusion separately, as we want to
|
||||||
|
|
Loading…
Reference in a new issue