This repository was archived by the owner on Jan 1, 2021. It is now read-only.
Fix bugs related to single-node ways being generated in a few places (#4378) #67
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I also merged the very similar RemoveNodeFromWayAction and
RemoveNodeByIndexAction into a rewritten RemoveNodeFromWayAction.
There's lots of fiddliness in this stuff to do with the undo model,
which necessitates writing actions "in the future", and also
various signals that can get bounced back and forth: removing a node
might necessitate removing the way, which in turn calls the node
removal code.
There's also the trickiness that sometimes single-node ways should exist,
especially during user interaction like drawing a way, or replacing a
node with another one during a merge.
I preserved the behaviour that RemoveNodeFromWayAction also cleans
out repeated nodes first. This shouldn't really be there, but at least
it's a separate code block, and can be removed at some future point.
There's also a bit of bonus source code commenting.