-
Notifications
You must be signed in to change notification settings - Fork 281
Constrained rotation #1226
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
Constrained rotation #1226
Conversation
Holding shift while rotating a selection with the move tool will snap the rotation to 15 degree increments
Except for some refactoring (I've made a pull request) I think it looks good, I have two comment though, the first is about the magic number (15) that is used for hand tool. Either we should use the same preference value as movetool or it should be mentioned that only selected tools uses the preference. My other comment is about the usability of the constraint when using the hand tool, as it doesn't respond as well as movetool. When you hold down alt and drag around, you kind of have to wriggle the mouse cursor to rotate but it's still inconsistent and in chunks. |
The constrained rotation was not supposed to be added to the hand tool, seems like I forgot about that and did it anyway during the second commit. Unfortunately the hand tool's rotation works fundamentally differently than the move tool right now, and it makes it impossible to properly implement the rotation constraints. Basically, the move tool recalculates the full rotation based on how much the mouse has moved since pressing down, and the hand tool only calculates the partial rotation based on how much the mouse has moved since the last mouse move event. The rotation constraint must round the full rotation, not the delta, which is not currently available to the hand tool. I will either remove the constraint support for the hand tool all together for now, or I will change the hand tool rotation if it's not too much work. It will use the preference if I get it working. |
I think removing it for now seems like the best choice, then we can merge this and properly fix the problem for hand tool. I'd like you to disregard my comment about the preference, as I didn't see that it was put under movetool. You may create a new setting for view rotation though or we could disable constrained rotation there for now. |
Refactor selectionmanager and movetool
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.
LGTM 👍
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.
Woo documentation, well done.
A rare sight indeed 😆 . I will merge this tomorrow if no objections come up. |
Thanks @candyface for the review and improvements. |
This PR enables constrained rotation for rotating selections. So when rotating selections, if you hold the shift key, the rotation will snap to the closest angle that's a multiple of n. n is 15 by default, but can be modified in the preferences to any number that divides 360 cleanly. This is to avoid some issues related to the math used.
Completely Fixes #1075