Skip to content
Permalink
Browse files

fix #5657

  • Loading branch information
jef-n committed May 28, 2012
1 parent e7e2c08 commit 5e45e876dc2ecc6305aee443d6266bd1c148c7d6
Showing with 17 additions and 0 deletions.
  1. +17 −0 src/app/nodetool/qgsselectedfeature.cpp
@@ -227,11 +227,23 @@ void QgsSelectedFeature::validationFinished()

void QgsSelectedFeature::deleteSelectedVertexes()
{
int nSelected = 0;
foreach( QgsVertexEntry *entry, mVertexMap )
{
if ( entry->isSelected() )
nSelected++;
}

if ( nSelected == 0 )
return;

int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
QMultiMap<double, QgsSnappingResult> currentResultList;

mVlayer->beginEditCommand( QObject::tr( "Deleted vertices" ) );

beginGeometryChange();

int count = 0;
for ( int i = mVertexMap.size() - 1; i > -1; i-- )
{
@@ -250,6 +262,11 @@ void QgsSelectedFeature::deleteSelectedVertexes()
mVlayer->snapWithContext( mVertexMap[i]->point(), ZERO_TOLERANCE, currentResultList, QgsSnapper::SnapToVertex );
}

// only last update should trigger the geometry update
// as vertex selection gets lost on the update
if ( --nSelected == 0 )
endGeometryChange();

if ( !mVlayer->deleteVertex( mFeatureId, i ) )
{
count = 0;

0 comments on commit 5e45e87

Please sign in to comment.
You can’t perform that action at this time.