Skip to content

Commit

Permalink
Don't zoomToSelected when nothing selected
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12460 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
borysiasty committed Dec 14, 2009
1 parent 4594371 commit 57855ad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gui/qgsmapcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,11 @@ void QgsMapCanvas::zoomToSelected( QgsVectorLayer* layer )
return;
}

if ( layer->selectedFeatureCount() == 0 )
{
return;
}

QgsRectangle rect = mMapRenderer->layerExtentToOutputExtent( layer, layer->boundingBoxOfSelected() );

// no selected features, only one selected point feature
Expand Down

0 comments on commit 57855ad

Please sign in to comment.