Skip to content
Permalink
Browse files

Make QgsMapCanvas.snapToCurrentLayer() work again (fixes #12631)

The snapper was called with screen coords instead of map coords
(due to implicit conversion QPoint->QgsPoint)
  • Loading branch information
wonder-sk committed Jun 18, 2015
1 parent 34cbbde commit e6466477136a440125108cbe2406cbf971ceff19
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/gui/qgsmapcanvassnapper.cpp
@@ -108,7 +108,8 @@ int QgsMapCanvasSnapper::snapToCurrentLayer( const QPoint& p, QList<QgsSnappingR
snapLayers.append( snapLayer );
mSnapper->setSnapLayers( snapLayers );

if ( mSnapper->snapMapPoint( p, results, excludePoints ) != 0 )
QgsPoint mapPoint = mMapCanvas->mapSettings().mapToPixel().toMapCoordinates( p );
if ( mSnapper->snapMapPoint( mapPoint, results, excludePoints ) != 0 )
return 4;

return 0;

0 comments on commit e646647

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