Skip to content
Permalink
Browse files
Make the "zoom to" action really zoom to a group box instead of pan
  • Loading branch information
DelazJ authored and github-actions committed Nov 18, 2021
1 parent ca41516 commit a10265a5ca856574244a42bd6fc99f0de1504672
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/gui/processing/models/qgsmodeldesignerdialog.cpp
@@ -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;
}

@@ -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 );

0 comments on commit a10265a

Please sign in to comment.