Test for contour parts of zero size and ignore them,
which otherwise leads to a segfault.
This commit is contained in:
parent
ab931442d0
commit
451e63f84e
1 changed files with 6 additions and 4 deletions
|
@ -1167,10 +1167,12 @@ TGPolygon reduce_degeneracy( const TGPolygon& poly ) {
|
||||||
TGPolygon result;
|
TGPolygon result;
|
||||||
|
|
||||||
for ( int i = 0; i < poly.contours(); ++i ) {
|
for ( int i = 0; i < poly.contours(); ++i ) {
|
||||||
// cout << "reduce_degeneracy() contour = " << i << endl;
|
if ( poly.get_contour(i).size() > 0)
|
||||||
point_list contour = poly.get_contour(i);
|
{
|
||||||
contour = reduce_contour_degeneracy( contour );
|
point_list contour = poly.get_contour(i);
|
||||||
result.add_contour( contour, poly.get_hole_flag(i) );
|
contour = reduce_contour_degeneracy( contour );
|
||||||
|
result.add_contour( contour, poly.get_hole_flag(i) );
|
||||||
|
}
|
||||||
|
|
||||||
// maintain original hole flag setting
|
// maintain original hole flag setting
|
||||||
// result.set_hole_flag( i, poly.get_hole_flag( i ) );
|
// result.set_hole_flag( i, poly.get_hole_flag( i ) );
|
||||||
|
|
Loading…
Reference in a new issue