Skip to content

Commit bcb7e44

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.
1 parent ba1de8b commit bcb7e44

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/app/nodetool/qgsmaptoolnodetool.cpp

+8-1
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)