Skip to content

Commit ca799f4

Browse files
author
g_j_m
committedApr 16, 2006
Part fix for ticket #80. Zoom to features are buffered slightly.
Doesn't yet work correctly for a single selected point yet... git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5284 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed
 

‎src/gui/qgsmapcanvas.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -513,13 +513,10 @@ void QgsMapCanvas::zoomToSelected()
513513
//zoom to an area
514514
else
515515
{
516-
// TODO: why such complicated way? [MD]
517-
QgsRect r;
518-
r.setXmin(rect.xMin());
519-
r.setYmin(rect.yMin());
520-
r.setXmax(rect.xMax());
521-
r.setYmax(rect.yMax());
522-
setExtent(r);
516+
// Expand rect to give a bit of space around the selected
517+
// objects so as to keep them clear of the map boundaries
518+
rect.expand(1.1);
519+
setExtent(rect);
523520
refresh();
524521
return;
525522
}

0 commit comments

Comments
 (0)
Please sign in to comment.