-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Continue drawing line or area at any point #9657
base: develop
Are you sure you want to change the base?
Conversation
The Continue operation can now enter drawing mode at any selected vertex, not just an endpoint. Continuing from a non-endpoint deletes that vertex before entering drawing mode to replace it.
// Unless an endpoint is selected, delete the selected node in favor of whatever we're going to draw. | ||
// This avoids a situation where it's possible to draw along all but one of the edges. | ||
if (!affix) { | ||
context.perform(actionDeleteNode(_vertex.id)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you select a vertex other than an endpoint, the operation replaces it with the newly drawn vertices. Otherwise, if we were to persist the selected vertex and only continue drawing along either adjacent edge, then either the first or the last edge of the way would become impossible to continue drawing along.
Ideally, this operation would detach the node from the way and only delete the node if it has no tags and no parents.
// If the position is a node index rather than an affix string, the node index will be dynamic based on an offset from the end. | ||
var offsetFromEndNode; | ||
if (typeof position === 'number') { | ||
offsetFromEndNode = context.entity(wayID).nodes.length - position - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you select a vertex other than an endpoint, you draw forward according to the way’s direction. This is simpler and more intuitive than devising a gesture to decide which direction to draw. However, it can get in the way when continuing to draw an area, since the Reverse operation is disabled for areas.
Hey. Very cool! However… I had been "secretly" working on a very similar feature recently. My version has the additional functionality to allow to "fly" along a line (or area outline) without having to re-select the start-vertex of the segment to be improved (similar to how it was proposed in #760): IMHO that functionality is quite important because in a typical use case (e.g. when improving the bends of a waterway or realigning of a path), one does typically want to work on more than just a single segment of a way. We talked about this the last monthly community meetup, but I definitely should have announced that I had started working on it in the issue #2272 to avoid duplicate work on it. Sorry for that! |
Oh cool, I had totally forgotten about #760. If I’m interpreting your screen recording correctly, you can enter drawing mode and click on an existing adjacent node to move it during drawing mode, correct? That satisfies the use cases I had in mind and gets closer to the request for a gesture in #2272 (comment). I’m curious about how the user can exit edit mode using the mouse if it has this additional behavior. Presumably the user won’t always want to redraw the entire line to the very end. I’ll leave this PR open for now to serve as a reference point, but I look forward to your better design! |
The Continue operation now allows you to draw freely starting from any point along the line, not only its endpoints. It works on closed lines and areas, too. This makes the operation useful for more tasks, for example:
In recognition of the Continue operation’s expanded abilities, it has been renamed to Draw.
draw480.mov
Fixes #2272.