Skip to content
Permalink
Browse files
prevent snapping to non-geometric layers (was leading to multiple log…
…s: Transform error caught inverse transform of ...)
  • Loading branch information
3nids committed Jan 31, 2014
1 parent dd0849d commit b834922fa24649785291aa2788d1007f58dfb69f
Showing with 4 additions and 1 deletion.
  1. +3 −0 src/core/qgssnapper.cpp
  2. +1 −1 src/gui/qgsmapcanvassnapper.cpp
@@ -54,6 +54,9 @@ int QgsSnapper::snapPoint( const QPoint& startPoint, QList<QgsSnappingResult>& s
QList<QgsSnapper::SnapLayer>::iterator snapLayerIt;
for ( snapLayerIt = mSnapLayers.begin(); snapLayerIt != mSnapLayers.end(); ++snapLayerIt )
{
if ( !snapLayerIt->mLayer->hasGeometryType() )
continue;

//transform point from map coordinates to layer coordinates
layerCoordPoint = mMapRenderer->mapToLayerCoordinates( snapLayerIt->mLayer, mapCoordPoint );

@@ -186,7 +186,7 @@ int QgsMapCanvasSnapper::snapToBackgroundLayers( const QPoint& p, QList<QgsSnapp

//layer
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( QgsMapLayerRegistry::instance()->mapLayer( *layerIt ) );
if ( !vlayer )
if ( !vlayer || !vlayer->hasGeometryType() )
continue;

snapLayer.mLayer = vlayer;

0 comments on commit b834922

Please sign in to comment.