Skip to content
Permalink
Browse files

Collapse 'Snap Items' to a single undo command when multiple items ar…

…e selected
  • Loading branch information
nyalldawson committed Mar 23, 2020
1 parent 7bba9de commit 598c2da77ad0b72aa7a0dfd73d7756565e51dabf
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/gui/processing/models/qgsmodelgraphicsview.cpp
@@ -439,9 +439,9 @@ void QgsModelGraphicsView::snapSelected()
{
QgsModelGraphicsScene *s = modelScene();
const QList<QgsModelComponentGraphicItem *> itemList = s->selectedComponentItems();
startMacroCommand( tr( "Snap Items" ) );
if ( !itemList.empty() )
{
itemList.at( 0 )->aboutToChange( tr( "Snap Items" ) );
bool prevSetting = mSnapper.snapToGrid();
mSnapper.setSnapToGrid( true );
for ( QgsModelComponentGraphicItem *item : itemList )
@@ -454,8 +454,8 @@ void QgsModelGraphicsView::snapSelected()
}
}
mSnapper.setSnapToGrid( prevSetting );
itemList.at( 0 )->changed();
}
endMacroCommand();
}


0 comments on commit 598c2da

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