Navigation Menu

Skip to content

Commit

Permalink
Keep zoom level constant if zooming to one selected point
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jun 7, 2013
1 parent 71b8825 commit 15e3fc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/qgsmapcanvas.cpp
Expand Up @@ -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
Expand Down

2 comments on commit 15e3fc3

@simgislab
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@mhugent
Copy link
Contributor Author

@mhugent mhugent commented on 15e3fc3 Jun 7, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.