-
Notifications
You must be signed in to change notification settings - Fork 99
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
Rotation snapping #21
Comments
It's already possible. You might have missed it, have a look at the class. :) |
@1-2-ka-4-4-2-ka-1 Could you explain more? I tried using the rotate matrix and even the decomposed values, but could not get it to work. |
Use the matrix returned by callback of Matrix Gesture Detector update the transform of |
You can manipulate this to actually get this I have got the same in one of my project |
I thought it was a public repo. Nevertheless, thank you. Will try using it |
@1-2-ka-4-4-2-ka-1 Thank you for the hint. The thing with your suggestion is. How do you handle for example that when you get close to a 90 degree rotation, to snap at 88 degrees keep it still till 92 degress and then let the user rotate further? Somehow you need track of the further rotation (that is not applied). I used to calculate a rotation value all the time to be able to identify the actual rotation but it lead to inconsistent behavior. Best regards |
|
See you want user to be able to rotate at exactly 90°. |
I you want to achieve in your way by imposing limits then you can stop listening in between the limits. |
@segidev I figured out how to do it for 0 degrees. Replace the rotate function with this code:
|
Would it be possible to add rotation snapping?
Something like this:
https://konvajs.org/docs/select_and_transform/Rotation_Snaps.html
That would be a great addition.
The text was updated successfully, but these errors were encountered: