From 213c277af52aa9b97e3c62bf413e40f6590090d7 Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Sun, 11 Aug 2024 12:47:39 +0700 Subject: [PATCH] Fix snapping result point reprojection when current layer has a Z/M dimension --- src/core/utils/snappingutils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/utils/snappingutils.cpp b/src/core/utils/snappingutils.cpp index bb77120d94..24cc2283ae 100644 --- a/src/core/utils/snappingutils.cpp +++ b/src/core/utils/snappingutils.cpp @@ -112,9 +112,9 @@ void SnappingUtils::snap() { const QgsFeature ft = match.layer()->getFeature( match.featureId() ); QgsPoint snappedPoint = newPoint( ft.geometry().vertexAt( match.vertexIndex() ), vlayer->wkbType() ); - if ( vlayer->crs() != mapSettings()->destinationCrs() ) + if ( match.layer()->crs() != mapSettings()->destinationCrs() ) { - QgsCoordinateTransform transform( vlayer->crs(), mapSettings()->destinationCrs(), QgsProject::instance()->transformContext() ); + QgsCoordinateTransform transform( match.layer()->crs(), mapSettings()->destinationCrs(), QgsProject::instance()->transformContext() ); try { snappedPoint.transform( transform );