Skip to content

Commit

Permalink
Collapse 'Snap Items' to a single undo command when multiple items ar…
Browse files Browse the repository at this point in the history
…e selected
  • Loading branch information
nyalldawson committed Mar 23, 2020
1 parent 7bba9de commit 598c2da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/processing/models/qgsmodelgraphicsview.cpp
Expand Up @@ -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 )
Expand All @@ -454,8 +454,8 @@ void QgsModelGraphicsView::snapSelected()
}
}
mSnapper.setSnapToGrid( prevSetting );
itemList.at( 0 )->changed();
}
endMacroCommand();
}


Expand Down

0 comments on commit 598c2da

Please sign in to comment.