Skip to content

Commit

Permalink
Fix for ticket #296 - the layer's coordinates have been projected als…
Browse files Browse the repository at this point in the history
…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 e1718bb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/legend/qgslegend.cpp
Original file line number Diff line number Diff line change
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 e1718bb

Please sign in to comment.