Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for ticket #296 - the layer's coordinates have been projected als…
…o with projections disabled.

Grrr... why there are 2 different implementations for zoom to layer extent?!
1. QgisApp
2. QgsLegend


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5960 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Oct 14, 2006
1 parent 828e7f2 commit 606bf57
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/legend/qgslegend.cpp
Expand Up @@ -1702,14 +1702,16 @@ void QgsLegend::zoomToLayerExtent()
if(theLayer)
{
layerExtent = theLayer->extent();
ct = theLayer->coordinateTransform();
if(ct)
{

if (QgsProject::instance()->readNumEntry("SpatialRefSys", "/ProjectionsEnabled",0) != 0
&& (ct = theLayer->coordinateTransform()))
{
//transform layer extent to canvas coordinate system
transformedExtent = ct->transform(layerExtent);
}
else
{
// do not transform when projections are not enabled
transformedExtent = layerExtent;
}

Expand Down

0 comments on commit 606bf57

Please sign in to comment.