Make indent, and finish writing a comment that I started

This commit is contained in:
Eric Fischer 2016-04-27 10:47:21 -07:00
parent 5cfd7cf68f
commit 87fea8082f

View File

@ -302,9 +302,6 @@ static void decode_clipped(ClipperLib::PolyNode *t, drawvec &out) {
// guaranteed that at least one point in the polygon is strictly
// inside its parent (not on one of its boundary lines).
// Once we have that, we can run through the outer rings that have
// an even number of parents,
std::vector<ring> rings;
decode_rings(t, rings);
std::sort(rings.begin(), rings.end());
@ -319,10 +316,15 @@ static void decode_clipped(ClipperLib::PolyNode *t, drawvec &out) {
}
}
}
nextring:
nextring:
;
}
// Then reverse the winding order of any rings that turned out
// to actually be inner when they are outer, or vice versa.
// (A ring is outer if it has no parent or if its parent is
// an inner ring.)
for (size_t ii = rings.size(); ii > 0; ii--) {
size_t i = ii - 1;
@ -339,6 +341,10 @@ nextring:
}
}
// Then run through the rings again, outputting each outer ring
// followed by its direct children, and checking to make sure
// there are no child rings whose parents weren't identified.
for (size_t ii = rings.size(); ii > 0; ii--) {
size_t i = ii - 1;
@ -535,11 +541,11 @@ void check_polygon(drawvec &geom, drawvec &before) {
if (t > 0 && t < 1 && s > 0 && s < 1) {
printf("Internal error: self-intersecting polygon. %lld,%lld to %lld,%lld intersects %lld,%lld to %lld,%lld\n",
geom[i + 0].x, geom[i + 0].y,
geom[i + 1].x, geom[i + 1].y,
geom[j + 0].x, geom[j + 0].y,
geom[j + 1].x, geom[j + 1].y);
dump(before);
geom[i + 0].x, geom[i + 0].y,
geom[i + 1].x, geom[i + 1].y,
geom[j + 0].x, geom[j + 0].y,
geom[j + 1].x, geom[j + 1].y);
dump(before);
}
}
}