Skip to content

Commit

Permalink
Fix self-snapping for layers with CRS that differs from project CRS
Browse files Browse the repository at this point in the history
Fixes #39268
  • Loading branch information
jdugge authored and nyalldawson committed Oct 25, 2020
1 parent c03c441 commit 7a14973
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/qgssnappingutils.cpp
Expand Up @@ -288,7 +288,7 @@ QgsPointLocator::Match QgsSnappingUtils::snapToMap( const QgsPointXY &pointMap,

for ( QgsVectorLayer *vl : mExtraSnapLayers )
{
QgsPointLocator *loc = locatorForLayer( vl );
QgsPointLocator *loc = locatorForLayerUsingStrategy( vl, pointMap, tolerance );
_updateBestMatch( bestMatch, pointMap, loc, type, tolerance, filter, false );
if ( mSnappingConfig.intersectionSnapping() )
edges << loc->edgesInRect( pointMap, tolerance );
Expand Down Expand Up @@ -357,7 +357,7 @@ QgsPointLocator::Match QgsSnappingUtils::snapToMap( const QgsPointXY &pointMap,

for ( QgsVectorLayer *vl : mExtraSnapLayers )
{
QgsPointLocator *loc = locatorForLayer( vl );
QgsPointLocator *loc = locatorForLayerUsingStrategy( vl, pointMap, maxTolerance );
_updateBestMatch( bestMatch, pointMap, loc, maxTypes, maxTolerance, filter, false );
if ( mSnappingConfig.intersectionSnapping() )
edges << loc->edgesInRect( pointMap, maxTolerance );
Expand Down Expand Up @@ -399,7 +399,7 @@ QgsPointLocator::Match QgsSnappingUtils::snapToMap( const QgsPointXY &pointMap,

for ( QgsVectorLayer *vl : mExtraSnapLayers )
{
QgsPointLocator *loc = locatorForLayer( vl );
QgsPointLocator *loc = locatorForLayerUsingStrategy( vl, pointMap, tolerance );
_updateBestMatch( bestMatch, pointMap, loc, type, tolerance, filter, false );
if ( mSnappingConfig.intersectionSnapping() )
edges << loc->edgesInRect( pointMap, tolerance );
Expand Down

0 comments on commit 7a14973

Please sign in to comment.