Skip to content
Permalink
Browse files

Keep zoom level constant if zooming to one selected point

  • Loading branch information
mhugent committed Jun 7, 2013
1 parent 71b8825 commit 15e3fc350972d5da83e9e68ecb6c0270f6b9f936
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/gui/qgsmapcanvas.cpp
@@ -746,7 +746,7 @@ void QgsMapCanvas::zoomToSelected( QgsVectorLayer* layer )
// zoom in
QgsPoint c = rect.center();
rect = extent();
rect.scale( 0.5, &c );
rect.scale( 1.0, &c );
}
//zoom to an area
else

2 comments on commit 15e3fc3

@simgislab

This comment has been minimized.

Copy link

@simgislab simgislab replied Jun 7, 2013

Marco, don't we have separate Pan Map to selection tool for panning without zooming? I believe Zoom should always zoom)

@mhugent

This comment has been minimized.

Copy link
Contributor Author

@mhugent mhugent replied Jun 7, 2013

In general I agree. However, in the special case of one selected point, the zoom extent is undefined. I think it is then better to not zoom than to zoom in double. E.g. say you select with expression and zoom to selection many times. If you have a lot of one-point selections, you zoom in more and more. Even if there is the pan to selection tool, if is unconvenient to check the number of selected objects before choosing the map tool.

Please sign in to comment.
You can’t perform that action at this time.