From 4fa41bf62d3abb1f706adce761ec22f5c0a7910b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bartoletti?= Date: Mon, 5 Oct 2020 15:42:56 +0200 Subject: [PATCH] Fix Z interpolation on vertex moved/added by the vertex tool. fixes #38561 --- src/app/vertextool/qgsvertextool.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/vertextool/qgsvertextool.cpp b/src/app/vertextool/qgsvertextool.cpp index 695e74243e3..a3b6504a187 100644 --- a/src/app/vertextool/qgsvertextool.cpp +++ b/src/app/vertextool/qgsvertextool.cpp @@ -2080,6 +2080,10 @@ void QgsVertexTool::moveVertex( const QgsPointXY &mapPoint, const QgsPointLocato QgsPoint layerPoint = matchToLayerPoint( dragLayer, mapPoint, mapPointMatch ); + // needed to get Z value + if ( mapPointMatch && mapPointMatch->layer() && QgsWkbTypes::hasZ( mapPointMatch->layer()->wkbType() ) && mapPointMatch->hasEdge() ) + layerPoint = mapPointMatch->interpolatedPoint(); + QgsVertexId vid; if ( !geom.vertexIdFromVertexNr( dragVertexId, vid ) ) {