mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Port over boolean #intersect() fix from c6b1a8067f5045e94294735a21aa2fa222fbb2a1
Relates to #870
This commit is contained in:
parent
fa9698aaaa
commit
bf65866b58
1 changed files with 7 additions and 2 deletions
|
@ -622,8 +622,11 @@ PathItem.inject(new function() {
|
||||||
var other = inter && inter._segment;
|
var other = inter && inter._segment;
|
||||||
// If we are at a crossing and the other segment is part of the
|
// If we are at a crossing and the other segment is part of the
|
||||||
// boolean result, switch to it.
|
// boolean result, switch to it.
|
||||||
if (other && isValid(other))
|
if (other && isValid(other)) {
|
||||||
|
if (operation === 'intersect')
|
||||||
|
seg._visited = true;
|
||||||
seg = other;
|
seg = other;
|
||||||
|
}
|
||||||
// If the new segment is visited already, check if we're back
|
// If the new segment is visited already, check if we're back
|
||||||
// at the start.
|
// at the start.
|
||||||
if (seg._visited) {
|
if (seg._visited) {
|
||||||
|
@ -649,7 +652,9 @@ PathItem.inject(new function() {
|
||||||
path.add(new Segment(seg._point, handleIn, seg._handleOut));
|
path.add(new Segment(seg._point, handleIn, seg._handleOut));
|
||||||
seg._visited = true;
|
seg._visited = true;
|
||||||
seg = seg.getNext();
|
seg = seg.getNext();
|
||||||
finished = isStart(seg);
|
if (isStart(seg)) {
|
||||||
|
finished = seg._visited = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Finish with closing the paths if necessary, correctly linking up
|
// Finish with closing the paths if necessary, correctly linking up
|
||||||
// curves etc.
|
// curves etc.
|
||||||
|
|
Loading…
Reference in a new issue