Skip to content
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

Add a “set start point” command #262

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eliheuer
Copy link
Collaborator

@eliheuer eliheuer commented Aug 4, 2021

This is an updated version of a previous PR I closed here: #260

This attempt is based on some feedback from the Zulip given by @cmyr:

The identity of the 'start point' is determined by a convention: In an open path, it is the first point in the list, and in a closed path (which is the only case where changing the start point really makes sense) it is the last point in a list.
So to implement this:
ensure that the path is closed
ensure that there is one selected point, and it is an on-curve
rotate the points to put this point at the end of the list
I would start by adding a method in point_list.rs, PathPoints::make_start(&mut self, point: EntityId). Then you'll want to call this from edit_session (likely via Path), passing in the id of the current selection.

Currently the command is in the Paths menu and works with the Shift+Ctrl+P command. If multiple points are selected it logs that info and does nothing, if one point is selected it calls make_start from Path.

I feel like I can figure out most of what is needed with a bit more work, but I'm a bit lost on the best way to do this. Specifically how to get the right EntityId in editor.rs and how to rotate the points.

Any feedback is welcome, I think I can figure most of this out on my own, it just takes me a long time.

Thanks!

2021-08-04-134622_1920x1080_scrot

@eliheuer eliheuer changed the title Add a set start point command Add a “set start point” command Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant