Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 8ca6cc7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui/layertree/qgslayertreemapcanvasbridge.cpp
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 8ca6cc7

Please sign in to comment.