Skip to content

Commit bcded3c

Browse files
author
Hugo Mercier
committed
Keep Z/M information when digitizing from a snapped point (fixes #14318)
1 parent 22b27c5 commit bcded3c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/gui/qgsmaptoolcapture.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,13 +376,14 @@ int QgsMapToolCapture::fetchLayerPoint( QgsPointLocator::Match match , QgsPointV
376376
{
377377
QgsFeature f;
378378
QgsFeatureRequest request;
379-
QgsPoint foundPoint;
380379
request.setFilterFid( match.featureId() );
381380
bool fetched = match.layer()->getFeatures( request ).nextFeature( f );
382381
if ( fetched )
383382
{
384-
foundPoint = f.geometry()->vertexAt( match.vertexIndex() );
385-
layerPoint = QgsPointV2( foundPoint.x(), foundPoint.y() );
383+
QgsVertexId vId;
384+
if ( !f.geometry()->vertexIdFromVertexNr( match.vertexIndex(), vId ) )
385+
return 2;
386+
layerPoint = f.geometry()->geometry()->vertexAt( vId );
386387
return 0;
387388
}
388389
else

0 commit comments

Comments
 (0)