Skip to content

Commit

Permalink
When deleting nodes from the end of a linestring, select the
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
nyalldawson committed Nov 18, 2015
1 parent 1449078 commit f679daa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/app/nodetool/qgsmaptoolnodetool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,14 @@ void QgsMapToolNodeTool::keyPressEvent( QKeyEvent* e )
}
else
{
safeSelectVertex( firstSelectedIndex );
int nextVertexToSelect = firstSelectedIndex;
if ( mSelectedFeature->geometry()->type() == QGis::Line )
{
// for lines we don't wrap around vertex selection when deleting nodes from end of line
nextVertexToSelect = qMin( nextVertexToSelect, mSelectedFeature->geometry()->geometry()->nCoordinates() - 1 );
}

safeSelectVertex( nextVertexToSelect );
}
mCanvas->refresh();

Expand Down

0 comments on commit f679daa

Please sign in to comment.