Skip to content

Commit 174dca2

Browse files
committed
Fix zoom last needs two clicks to reset view for zoom tool
(fix #13095) (cherry-picked from b50c603)
1 parent 56613cc commit 174dca2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/gui/qgsmaptoolzoom.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ void QgsMapToolZoom::canvasReleaseEvent( QMouseEvent * e )
117117
const QgsMapToPixel* m2p = mCanvas->getCoordinateTransform();
118118
QgsPoint c = m2p->toMapCoordinates( mZoomRect.center() );
119119

120-
mCanvas->setCenter( c );
121-
mCanvas->zoomByFactor( mZoomOut ? 1.0 / sf : sf );
120+
mCanvas->zoomByFactor( mZoomOut ? 1.0 / sf : sf, &c );
122121

123122
mCanvas->refresh();
124123
}

0 commit comments

Comments
 (0)