Skip to content

Commit

Permalink
Minor tweak to PolyTree path ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
AngusJohnson committed May 16, 2023
1 parent 117f885 commit f2331c4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CPP/Clipper2Lib/src/clipper.engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,11 @@ namespace Clipper2Lib {
return outrec;
}

inline bool GetRealSplit(OutRec* split, OutRec* outrec)
{
while (split && split != outrec && !split->pts) split = split->owner;
return split != outrec;
}

inline void UncoupleOutRec(Active ae)
{
Expand Down Expand Up @@ -2831,10 +2836,9 @@ namespace Clipper2Lib {

bool ClipperBase::CheckSplitOwner(OutRec* outrec, OutRecList* splits)
{
for (auto s : *splits)
for (auto split : *splits)
{
OutRec* split = GetRealOutRec(s);
if (!split || split == outrec || split == outrec->owner) continue;
if (!GetRealSplit(split, outrec) || !split) continue;
else if (split->splits && CheckSplitOwner(outrec, split->splits)) return true;
else if (CheckBounds(split) && split->bounds.Contains(outrec->bounds) &&
Path1InsidePath2(outrec->pts, split->pts))
Expand Down

0 comments on commit f2331c4

Please sign in to comment.