mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-03-13 16:33:28 -04:00
Merge handling of self-intersection crossings with normal crossings.
Shorter code and no additional glitches.
This commit is contained in:
parent
08122131dc
commit
bcd6520e66
1 changed files with 4 additions and 9 deletions
|
@ -737,10 +737,10 @@ PathItem.inject(new function() {
|
|||
// Just add the first segment and all segments that have no
|
||||
// intersection.
|
||||
drawSegment(seg, null, 'add', i, 'black');
|
||||
} else if (!operator) { // Resolve self-intersections
|
||||
drawSegment(seg, other, 'self-int', i, 'purple');
|
||||
// Switch to the intersecting segment, as we need to
|
||||
// resolving self-Intersections.
|
||||
} else if (isValid(other)) {
|
||||
// The other segment is part of the boolean result, and we
|
||||
// are at crossing, switch over.
|
||||
drawSegment(seg, other, 'cross', i, 'green');
|
||||
seg = other;
|
||||
} else if (inter.isOverlap() && operation !== 'intersect') {
|
||||
// Switch to the overlapping intersecting segment if it is
|
||||
|
@ -756,11 +756,6 @@ PathItem.inject(new function() {
|
|||
// switch at each crossing.
|
||||
drawSegment(seg, other, 'exclude-cross', i, 'green');
|
||||
seg = other;
|
||||
} else if (isValid(other)) {
|
||||
// The other segment is part of the boolean result, and we
|
||||
// are at crossing, switch over.
|
||||
drawSegment(seg, other, 'cross', i, 'green');
|
||||
seg = other;
|
||||
} else {
|
||||
// Keep on truckin'
|
||||
drawSegment(seg, null, 'stay', i, 'blue');
|
||||
|
|
Loading…
Reference in a new issue