Skip to content

Commit

Permalink
Fixed snapping to background layers if there's a layer that doesn't e…
Browse files Browse the repository at this point in the history
…xist. Fixes #2261

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12515 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Dec 19, 2009
1 parent 6a314a5 commit 06cbd6d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/gui/qgsmapcanvassnapper.cpp
Expand Up @@ -185,14 +185,13 @@ int QgsMapCanvasSnapper::snapToBackgroundLayers( const QPoint& p, QList<QgsSnapp

//layer
layer = QgsMapLayerRegistry::instance()->mapLayer( *layerIt );
if ( layer )
{
vlayer = qobject_cast<QgsVectorLayer *>( layer );
if ( vlayer )
{
snapLayer.mLayer = vlayer;
}
}
if ( layer == NULL )
continue;
vlayer = qobject_cast<QgsVectorLayer *>( layer );
if ( vlayer == NULL )
continue;

snapLayer.mLayer = vlayer;

//tolerance
snapLayer.mTolerance = tolIt->toDouble();
Expand Down

0 comments on commit 06cbd6d

Please sign in to comment.