Skip to content
Permalink
Browse files

Merge pull request #636 from vinayan/zoomlayerextent

[Fix #7333] - Zoom to layer does not work anymore for newly created shapefiles
  • Loading branch information
NathanW2 committed Jun 5, 2013
2 parents c1fb1bb + 74b18e5 commit e7ea582ee15a421f9d226f86bceb92f973a657e3
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 e7ea582

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