Skip to content

Commit 5e45e87

Browse files
committed
fix #5657
1 parent e7e2c08 commit 5e45e87

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/app/nodetool/qgsselectedfeature.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,23 @@ void QgsSelectedFeature::validationFinished()
227227

228228
void QgsSelectedFeature::deleteSelectedVertexes()
229229
{
230+
int nSelected = 0;
231+
foreach( QgsVertexEntry *entry, mVertexMap )
232+
{
233+
if ( entry->isSelected() )
234+
nSelected++;
235+
}
236+
237+
if ( nSelected == 0 )
238+
return;
239+
230240
int topologicalEditing = QgsProject::instance()->readNumEntry( "Digitizing", "/TopologicalEditing", 0 );
231241
QMultiMap<double, QgsSnappingResult> currentResultList;
232242

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

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

265+
// only last update should trigger the geometry update
266+
// as vertex selection gets lost on the update
267+
if ( --nSelected == 0 )
268+
endGeometryChange();
269+
253270
if ( !mVlayer->deleteVertex( mFeatureId, i ) )
254271
{
255272
count = 0;

0 commit comments

Comments
 (0)