-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
Fix EditorSpinSlider bad mouse position and zoom issues (Fix #46632 & #46708) #46693
Fix EditorSpinSlider bad mouse position and zoom issues (Fix #46632 & #46708) #46693
Conversation
2d8a848
to
847450b
Compare
In the |
@gongpha Sometimes, there is a factor applied : the mouse relative motion doesn't match with the visual grabber moves. I suppose that's why mouse is now captured to hide the divergence between knob and real mouse pointer. |
@jmb462 I meant an actual slider grabber is currently not working (it's broken earlier). The changes you made are for spinbox grabbing. That meaning it's able to start grabbing anywhere inside the box. In the picture, The mouse position returned to the grabber position. Including when start grabbing on outside the slider. |
I think that :
2 ) The round grabber should be visible while dragging I will try to modify in that way. |
As a top_level control, it doesn't inherits from its parents' transform. It may cause the problem with zoomed GraphEdit. For the second part (mouse position / grabber visibility), this should return to normal if #44334 is fixed. I think I should close this PR, and repost a PR for just fixing #46632. (done => PR #46943) No idea how to fix #44334. |
Closed this one and open the new PR for grabber zoom only #46943 |
Fix #46632 & #46708 issues
As described in the issue mentionned, EditorSpinSlider grabber was not at the correct position when GraphEdit zoom wasn't set to 1.
Also the mouse position when releasing the grabber was incorrect.
Solution :
Scale in now applied when calculating the grabber position.
I use get_global_transform_with_canvas().get_scale() to get the scale.
Also, the visual size of the grabber is now correctly scaled.
Finaly, the mouse position when we released the grabber is set correctly at the grabber position.
Zoom fix :
(Note that this gif has been captured before the mouse fix was added, so the mouse position is weird but now it's ok)
Mouse position fix :
Before :
After :