Navigation Menu

Skip to content

Commit

Permalink
fix zoom issue for new shapefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayan committed Jun 5, 2013
1 parent 4337d8d commit 74b18e5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -2675,6 +2675,15 @@ void QgsLegend::legendLayerZoom()
QgsMapLayer* theLayer = currentLayer->layer();
extent = theLayer->extent();

QgsVectorLayer* vLayer = qobject_cast<QgsVectorLayer*>( theLayer );

if ( extent.isEmpty() && vLayer )
{
vLayer->updateExtents();
extent = vLayer->extent();
}


//transform extent if otf-projection is on
if ( mMapCanvas->hasCrsTransformEnabled() )
{
Expand All @@ -2697,6 +2706,14 @@ void QgsLegend::legendLayerZoom()
QgsMapLayer* theLayer = layers.at( i )->layer();
layerExtent = theLayer->extent();

QgsVectorLayer* vLayer = qobject_cast<QgsVectorLayer*>( theLayer );

if ( extent.isEmpty() && vLayer )
{
vLayer->updateExtents();
layerExtent = vLayer->extent();
}

//transform extent if otf-projection is on
if ( mMapCanvas->hasCrsTransformEnabled() )
{
Expand Down

0 comments on commit 74b18e5

Please sign in to comment.