Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix drag to zoom
  • Loading branch information
uclaros authored and github-actions[bot] committed Sep 17, 2021
1 parent 0e2e98b commit 5888766
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -1707,15 +1707,15 @@ void QgsMapCanvas::endZoomRect( QPoint pos )
mZoomRect.setRight( pos.x() );
mZoomRect.setBottom( pos.y() );

//account for bottom right -> top left dragging
mZoomRect = mZoomRect.normalized();

if ( mZoomRect.width() < 5 && mZoomRect.height() < 5 )
{
//probably a mistake - would result in huge zoom!
return;
}

//account for bottom right -> top left dragging
mZoomRect = mZoomRect.normalized();

// set center and zoom
const QSize &zoomRectSize = mZoomRect.size();
const QSize &canvasSize = mSettings.outputSize();
Expand Down

0 comments on commit 5888766

Please sign in to comment.