Skip to content

Commit f679daa

Browse files
committed
When deleting nodes from the end of a linestring, select the
final node following a delete rather than reverting to the first node. Improves workflow when deleting sequential nodes from end of lines. (cherry-picked from bcb7e44)
1 parent 1449078 commit f679daa

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/app/nodetool/qgsmaptoolnodetool.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,14 @@ void QgsMapToolNodeTool::keyPressEvent( QKeyEvent* e )
546546
}
547547
else
548548
{
549-
safeSelectVertex( firstSelectedIndex );
549+
int nextVertexToSelect = firstSelectedIndex;
550+
if ( mSelectedFeature->geometry()->type() == QGis::Line )
551+
{
552+
// for lines we don't wrap around vertex selection when deleting nodes from end of line
553+
nextVertexToSelect = qMin( nextVertexToSelect, mSelectedFeature->geometry()->geometry()->nCoordinates() - 1 );
554+
}
555+
556+
safeSelectVertex( nextVertexToSelect );
550557
}
551558
mCanvas->refresh();
552559

0 commit comments

Comments
 (0)