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 angle-snapping when rotating #22

Open
aleksandar-stefanovic opened this issue Jan 14, 2018 · 2 comments
Open

Add angle-snapping when rotating #22

aleksandar-stefanovic opened this issue Jan 14, 2018 · 2 comments

Comments

@aleksandar-stefanovic
Copy link

I've implemented that like this:

If the object is rotated, by dragging the node, by a rotation amount (in degrees, for this example), then the actual rotation would be equal to:

rotation - rotation % 15

For example, if the input rotation is 67°, then the applied rotation would be 67 - 67 % 15 = 67 - 7 = 60.

And that works fine. However, this isn't the default behavior in 99% of the software I've used, but rather, it's freehand rotation, until you press a key (most likely Ctrl), and then the snapping is applied. And currently I don't know how to detect whether Ctrl is pressed or not, so I can't finish this feature on my own (if I figure it out, I will send in a PR).

@Philip-Scott
Copy link
Member

The move action has a way to detect the modifier keys https://github.com/Philip-Scott/libgtkcanvas/blob/master/src/Utils/MoveAction.vala#L40

But I would wait a bit before trying to implement this here for now. A big re-write is in the way to implement the drawing of the shapes using SVGs (see #20)

But thank you for your work anyways :) really appreciate you taking your time to make this and Spice-Up better!

@aleksandar-stefanovic
Copy link
Author

aleksandar-stefanovic commented Jan 15, 2018

No problem, I will wait until #20 is merged, and then I will work on this 🙂

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

No branches or pull requests

2 participants