Skip to content
Permalink
Browse files

fix zoom issue for new shapefiles

  • Loading branch information
vinayan committed Jun 5, 2013
1 parent 4337d8d commit 74b18e532a73c9f11cbf3e06db84476f6cf2e433
Showing with 17 additions and 0 deletions.
  1. +17 −0 src/app/legend/qgslegend.cpp
@@ -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() )
{
@@ -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() )
{

0 comments on commit 74b18e5

Please sign in to comment.
You can’t perform that action at this time.