Skip to content
Permalink
Browse files
Zoom to layer extent when adding the first layer
  • Loading branch information
mhugent committed Apr 6, 2012
1 parent fdceb2f commit 30eaf192e731aeaa74780123ada445bfda971737
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/app/legend/qgslegend.cpp
@@ -872,7 +872,10 @@ void QgsLegend::addLayers( QList<QgsMapLayer *> theLayerList )
//Note if the canvas was previously blank so we can
//zoom to all layers at the end if neeeded
bool myFirstLayerFlag = false;
if ( layers().count() > 0 ) myFirstLayerFlag = true;
if ( layers().count() < 1 )
{
myFirstLayerFlag = true;
}

//iteratively add the layers to the canvas
for ( int i = 0; i < theLayerList.size(); ++i )

0 comments on commit 30eaf19

Please sign in to comment.