Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make the "zoom to" action really zoom to a group box instead of pan
  • Loading branch information
DelazJ authored and github-actions[bot] committed Nov 18, 2021
1 parent ca41516 commit a10265a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/processing/models/qgsmodeldesignerdialog.cpp
Expand Up @@ -534,7 +534,7 @@ bool QgsModelDesignerDialog::validateSave()
{
if ( mNameEdit->text().trimmed().isEmpty() )
{
mMessageBar->pushWarning( QString(), tr( "Please a enter model name before saving" ) );
mMessageBar->pushWarning( QString(), tr( "Please enter a model name before saving" ) );
return false;
}

Expand Down Expand Up @@ -835,6 +835,9 @@ void QgsModelDesignerDialog::populateZoomToMenu()
QAction *zoomAction = new QAction( box.description(), mGroupMenu );
connect( zoomAction, &QAction::triggered, this, [ = ]
{
QRectF groupRect = item->boundingRect();
groupRect.adjust( -10, -10, 10, 10 );
mView->fitInView( groupRect, Qt::KeepAspectRatio );
mView->centerOn( item );
} );
mGroupMenu->addAction( zoomAction );
Expand Down

0 comments on commit a10265a

Please sign in to comment.