Skip to content

Commit

Permalink
Fix incorrect projection if raster or plugin layer is first layer
Browse files Browse the repository at this point in the history
loaded into an empty project (fix #14392)
  • Loading branch information
nyalldawson committed Mar 15, 2016
1 parent 054894a commit 15d2be2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui/layertree/qgslayertreemapcanvasbridge.cpp
Original file line number Diff line number Diff line change
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

1 comment on commit 15d2be2

@nirvn
Copy link
Contributor

@nirvn nirvn commented on 15d2be2 Mar 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.