mirror of
https://github.com/qgis/QGIS.git
synced 2025-06-19 00:02:48 -04:00
Remove the whole ring / linestring if number of vertices to small
This commit is contained in:
parent
416c004a08
commit
bf3fbec755
@ -702,7 +702,7 @@ bool QgsCurvePolygonV2::deleteVertex( const QgsVertexId& vId )
|
||||
|
||||
QgsCurveV2* ring = vId.ring == 0 ? mExteriorRing : mInteriorRings.at( vId.ring - 1 );
|
||||
int n = ring->numPoints();
|
||||
if ( n <= 2 )
|
||||
if ( n <= 4 )
|
||||
{
|
||||
//no points will be left in ring, so remove whole ring
|
||||
if ( vId.ring == 0 )
|
||||
|
@ -644,6 +644,12 @@ bool QgsLineStringV2::deleteVertex( const QgsVertexId& position )
|
||||
{
|
||||
mM.remove( position.vertex );
|
||||
}
|
||||
|
||||
if( numPoints() == 1 )
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
mBoundingBox = QgsRectangle(); //set bounding box invalid
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user