Fix incorrect projection if raster or plugin layer is first layer

loaded into an empty project (fix #14392)
This commit is contained in:
Nyall Dawson 2016-03-15 12:18:24 +11:00
parent 054894a3dc
commit 15d2be26f1

View File

@ -144,10 +144,10 @@ void QgsLayerTreeMapCanvasBridge::setCanvasLayers()
continue;
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( layerNode->layer() );
if ( vl && vl->geometryType() != QGis::NoGeometry )
if ( !vl || vl->geometryType() != QGis::NoGeometry )
{
mCanvas->setDestinationCrs( vl->crs() );
mCanvas->setMapUnits( vl->crs().mapUnits() );
mCanvas->setDestinationCrs( layerNode->layer()->crs() );
mCanvas->setMapUnits( layerNode->layer()->crs().mapUnits() );
break;
}
}