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.
  • Loading branch information
nyalldawson committed Oct 29, 2015
1 parent ba1de8b commit bcb7e44
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 bcb7e44

Please sign in to comment.