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)

(cherry picked from commit e646647)
  • Loading branch information
wonder-sk committed Jun 18, 2015
1 parent be0dae1 commit 65748d50db0332df979b2bd7b1e70c175be59edd
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 65748d5

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