Skip to content
Permalink
Browse files

Make zoomToLayer, zoomFull and zoomSelected all adds the same five pe…

…rcent margin around the extent. Fixes #932.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8099 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Feb 2, 2008
1 parent 68723cb commit 5fcec96022be9cc6df4dac0a826bf147350b3217
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/gui/qgsmapcanvas.cpp
@@ -493,7 +493,11 @@ void QgsMapCanvas::zoomFullExtent()
QgsRect extent = fullExtent();
// If the full extent is an empty set, don't do the zoom
if (!extent.isEmpty())
{
// Add a 5% margin around the full extent
extent.scale(1.05);
setExtent(extent);
}
refresh();

} // zoomFullExtent
@@ -561,7 +565,8 @@ void QgsMapCanvas::zoomToSelected()
{
// Expand rect to give a bit of space around the selected
// objects so as to keep them clear of the map boundaries
rect.scale(1.1);
// The same 5% should apply to all margins.
rect.scale(1.05);
setExtent(rect);
refresh();
return;

0 comments on commit 5fcec96

Please sign in to comment.