Skip to content

Commit

Permalink
Zoom to layer extent when adding the first layer
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Apr 6, 2012
1 parent fdceb2f commit 30eaf19
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/legend/qgslegend.cpp
Expand Up @@ -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 )
Expand Down

0 comments on commit 30eaf19

Please sign in to comment.