Skip to content
Permalink
Browse files

Fix incorrect projection if raster or plugin layer is first layer

loaded into an empty project (fix #14392)
  • Loading branch information
nyalldawson committed Mar 15, 2016
1 parent 054894a commit 15d2be26f1235d9ec18b48f09376390c3a6e2d00
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;
}
}

1 comment on commit 15d2be2

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn commented on 15d2be2 Mar 15, 2016

@nyalldawson , on behalf of the whole world, thanks for fixing this one out.

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