diff --git a/common/geometry/shape_poly_set.cpp b/common/geometry/shape_poly_set.cpp index 922c0ace0c..c9789cf624 100644 --- a/common/geometry/shape_poly_set.cpp +++ b/common/geometry/shape_poly_set.cpp @@ -350,7 +350,7 @@ static int processEdge( FractureEdgeSet& edges, FractureEdge* edge ) int dist = ( x - x_intersect ); - if( dist > 0 && dist < min_dist ) + if( dist >= 0 && dist < min_dist && (*i)->m_connected ) { min_dist = dist; x_nearest = x_intersect; @@ -362,7 +362,7 @@ static int processEdge( FractureEdgeSet& edges, FractureEdge* edge ) { int count = 0; - FractureEdge* lead1 = new FractureEdge( true, VECTOR2I( x_nearest, y ), VECTOR2I( x, y ) ); + FractureEdge* lead1 = new FractureEdge( true, VECTOR2I( x_nearest, y ), VECTOR2I( x, y ) ); FractureEdge* lead2 = new FractureEdge( true, VECTOR2I( x, y ), VECTOR2I( x_nearest, y ) ); FractureEdge* split_2 = new FractureEdge( true, VECTOR2I( x_nearest, y ), e_nearest->m_p2 );