Eliminate infinite loop AssemblePolygon
This commit is contained in:
parent
7366a6c53d
commit
88a0e55f35
@ -269,7 +269,6 @@ bool SEdgeList::AssemblePolygon(SPolygon *dest, SEdge *errorAt, bool keepDir) co
|
||||
dest->Clear();
|
||||
|
||||
bool allClosed = true;
|
||||
for(;;) {
|
||||
Vector first = Vector::From(0, 0, 0);
|
||||
Vector last = Vector::From(0, 0, 0);
|
||||
int i;
|
||||
@ -279,13 +278,6 @@ bool SEdgeList::AssemblePolygon(SPolygon *dest, SEdge *errorAt, bool keepDir) co
|
||||
last = l[i].b;
|
||||
/// @todo fix const!
|
||||
const_cast<SEdge*>(&(l[i]))->tag = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(i >= l.n) {
|
||||
return allClosed;
|
||||
}
|
||||
|
||||
// Create a new empty contour in our polygon, and finish assembling
|
||||
// into that contour.
|
||||
dest->AddEmptyContour();
|
||||
@ -295,6 +287,8 @@ bool SEdgeList::AssemblePolygon(SPolygon *dest, SEdge *errorAt, bool keepDir) co
|
||||
// But continue assembling, even if some of the contours are open
|
||||
}
|
||||
}
|
||||
return allClosed;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Test if the specified edge crosses any of the edges in our list. Two edges
|
||||
|
Loading…
Reference in New Issue
Block a user