Use isOverlap() instead of _overlap everywhere.

This commit is contained in:
Jürg Lehni 2015-10-20 23:02:50 +02:00
parent 6ccd78e8af
commit 08122131dc

View file

@ -611,7 +611,7 @@ PathItem.inject(new function() {
return true; return true;
var winding = seg._winding, var winding = seg._winding,
inter = seg._intersection; inter = seg._intersection;
if (inter && !unadjusted && overlapWinding && inter._overlap) if (inter && !unadjusted && overlapWinding && inter.isOverlap())
winding = overlapWinding[winding] || winding; winding = overlapWinding[winding] || winding;
return operator(winding); return operator(winding);
} }
@ -641,15 +641,15 @@ PathItem.inject(new function() {
+ ', seg wi:' + seg._winding + ', seg wi:' + seg._winding
+ ', next wi:' + nextSeg._winding + ', next wi:' + nextSeg._winding
+ ', seg op:' + isValid(seg, true) + ', seg op:' + isValid(seg, true)
+ ', next op:' + ', next op:' + (!(strict && nextInter
+ (!(strict && nextInter && nextInter._overlap) && nextInter.isOverlap())
&& isValid(nextSeg, true) && isValid(nextSeg, true)
|| !strict && nextInter || !strict && nextInter
&& isValid(nextInter._segment, true)) && isValid(nextInter._segment, true))
+ ', seg ov: ' + !!(seg._intersection + ', seg ov: ' + !!(seg._intersection
&& seg._intersection._overlap) && seg._intersection.isOverlap())
+ ', next ov: ' + !!(nextSeg._intersection + ', next ov: ' + !!(nextSeg._intersection
&& nextSeg._intersection._overlap) && nextSeg._intersection.isOverlap())
+ ', more: ' + (!!inter._next)); + ', more: ' + (!!inter._next));
} }
// See if this segment and the next are both not visited yet, or // See if this segment and the next are both not visited yet, or
@ -675,7 +675,7 @@ PathItem.inject(new function() {
// Do not consider nextSeg in strict mode if it is part // Do not consider nextSeg in strict mode if it is part
// of an overlap, in order to give non-overlapping // of an overlap, in order to give non-overlapping
// options that might follow the priority over overlaps. // options that might follow the priority over overlaps.
&& (!(strict && nextInter && nextInter._overlap) && (!(strict && nextInter && nextInter.isOverlap())
&& isValid(nextSeg, true) && isValid(nextSeg, true)
// If the next segment isn't valid, its intersection // If the next segment isn't valid, its intersection
// to which we may switch might be, so check that. // to which we may switch might be, so check that.
@ -742,7 +742,7 @@ PathItem.inject(new function() {
// Switch to the intersecting segment, as we need to // Switch to the intersecting segment, as we need to
// resolving self-Intersections. // resolving self-Intersections.
seg = other; seg = other;
} else if (inter._overlap && operation !== 'intersect') { } else if (inter.isOverlap() && operation !== 'intersect') {
// Switch to the overlapping intersecting segment if it is // Switch to the overlapping intersecting segment if it is
// part of the boolean result. Do not adjust for overlap! // part of the boolean result. Do not adjust for overlap!
if (isValid(other, true)) { if (isValid(other, true)) {