Skip to content

Commit

Permalink
fix #5657
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 28, 2012
1 parent e7e2c08 commit 5e45e87
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/app/nodetool/qgsselectedfeature.cpp
Expand Up @@ -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-- )
{
Expand All @@ -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;
Expand Down

0 comments on commit 5e45e87

Please sign in to comment.