Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 Jul 7, 2015
1 parent be0dae1 commit 65748d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/qgsmapcanvassnapper.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 65748d5

Please sign in to comment.