Skip to content
Permalink
Browse files

Fix incorrect projection if raster or plugin layer is first layer

loaded into an empty project (fix #14392)

(cherry-picked from 15d2be2)
  • Loading branch information
nyalldawson committed Mar 15, 2016
1 parent 0bde785 commit 8ca6cc7961f8c7b93464814d5504c6816146ca90
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/gui/layertree/qgslayertreemapcanvasbridge.cpp
@@ -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;
}
}

0 comments on commit 8ca6cc7

Please sign in to comment.
You can’t perform that action at this time.