1
0
Fork 0

Fix a logical bug in the routine which strips out holes from a multi-contour

polygon.
This commit is contained in:
curt 2004-11-11 15:07:14 +00:00
parent fb71b5876c
commit 06978b3cc4

View file

@ -558,7 +558,7 @@ TGPolygon tgPolygonSplitLongEdges( const TGPolygon &poly, double max_len ) {
} }
// Traverse a polygon and toss all the internal holes // Traverse a polygon and return the union of all the non-hole contours
TGPolygon tgPolygonStripHoles( const TGPolygon &poly ) { TGPolygon tgPolygonStripHoles( const TGPolygon &poly ) {
TGPolygon result; result.erase(); TGPolygon result; result.erase();
@ -568,7 +568,9 @@ TGPolygon tgPolygonStripHoles( const TGPolygon &poly ) {
// SG_LOG(SG_GENERAL, SG_DEBUG, "contour = " << i); // SG_LOG(SG_GENERAL, SG_DEBUG, "contour = " << i);
point_list contour = poly.get_contour( i ); point_list contour = poly.get_contour( i );
if ( ! poly.get_hole_flag(i) ) { if ( ! poly.get_hole_flag(i) ) {
result.add_contour( contour, poly.get_hole_flag(i) ); TGPolygon tmp;
tmp.add_contour( contour, poly.get_hole_flag(i) );
result = tgPolygonUnion( tmp, result );
} }
} }