From 0b2a9258d7eb4bfd1339eedf95280e97c2f51b1b Mon Sep 17 00:00:00 2001 From: olivierdalang Date: Thu, 9 May 2019 14:53:50 +0200 Subject: [PATCH] [FEATURE] vertextool : chained add vertex at endpoint This makes it possible to digitizle multiple points at once when extending a line feature with the vertex tool --- src/app/vertextool/qgsvertextool.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/vertextool/qgsvertextool.cpp b/src/app/vertextool/qgsvertextool.cpp index 178f1ccab99..ee15224b0b7 100644 --- a/src/app/vertextool/qgsvertextool.cpp +++ b/src/app/vertextool/qgsvertextool.cpp @@ -2040,6 +2040,18 @@ void QgsVertexTool::moveVertex( const QgsPointXY &mapPoint, const QgsPointLocato setHighlightedVertices( mSelectedVertices ); // update positions of existing highlighted vertices setHighlightedVerticesVisible( true ); // time to show highlighted vertices again + + // restart startDraggingAddVertexAtEndpoint right after it finishes + if ( addingAtEndpoint ) + { + if ( mMouseAtEndpoint->vertexId != 0 ) + { + // If we were adding at the end of the featue, we need to update the index + mMouseAtEndpoint.reset( new Vertex( mMouseAtEndpoint->layer, mMouseAtEndpoint->fid, mMouseAtEndpoint->vertexId + 1 ) ); + } + // And then we just restart the drag + startDraggingAddVertexAtEndpoint( mapPoint ); + } }