Fix for ticket #296 - the layer's coordinates have been projected also 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
This commit is contained in:
wonder 2006-10-14 13:23:51 +00:00
parent 75b6817736
commit e1718bbc29

View File

@ -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;
}