Skip to content
Permalink
Browse files
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@5960 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Oct 14, 2006
1 parent 75b6817 commit e1718bbc29e6fa719d3ede2e1493b7f73f7faf0f
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/legend/qgslegend.cpp
@@ -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;
}

0 comments on commit e1718bb

Please sign in to comment.