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

Fix EditorSpinSlider bad mouse position and zoom issues (Fix #46632 & #46708) #46693

Closed

Conversation

jmb462
Copy link
Contributor

@jmb462 jmb462 commented Mar 5, 2021

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)
slider

Mouse position fix :

Before :
before

After :
after

@jmb462 jmb462 changed the title Fix EditorSpinSlider Grabber bad position when Zoom in or out Fix EditorSpinSlider Grabber bad position when Zoom in or out (Fix #46632) Mar 5, 2021
@akien-mga akien-mga added this to the 4.0 milestone Mar 5, 2021
@jmb462 jmb462 force-pushed the fix-slider-grabber-zoomed-position branch from 2d8a848 to 847450b Compare March 5, 2021 21:49
@jmb462 jmb462 changed the title Fix EditorSpinSlider Grabber bad position when Zoom in or out (Fix #46632) Fix EditorSpinSlider Grabber bad position when Zoom in or out (Fix #46632 & #46708) Mar 5, 2021
@jmb462 jmb462 changed the title Fix EditorSpinSlider Grabber bad position when Zoom in or out (Fix #46632 & #46708) Fix EditorSpinSlider bad mouse position and zoom issues (Fix #46632 & #46708) Mar 5, 2021
@gongpha
Copy link
Contributor

gongpha commented Mar 10, 2021

In the master branch, EditorSpinSlider's grabber still bugged when dragging on. If compared with 3.2, when dragging on grabbers, They should highlight and the returned value could same as the actual mouse position. Not like when dragging on spinbox space. (See #44318)

@jmb462
Copy link
Contributor Author

jmb462 commented Mar 10, 2021

@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.
I think it's more a feature than a bug.

@gongpha
Copy link
Contributor

gongpha commented Mar 10, 2021

@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.

a

In the picture, The mouse position returned to the grabber position. Including when start grabbing on outside the slider.
Did you expect this ?

@jmb462
Copy link
Contributor Author

jmb462 commented Mar 10, 2021

I think that :

  1. the mouse cursor should reappear on the grabber only if the grabber was used and reappear at the same point he desappear if the grabber wasn't used ?

2 ) The round grabber should be visible while dragging

I will try to modify in that way.

@gongpha
Copy link
Contributor

gongpha commented Mar 10, 2021

I think #44334 (like #44318) should be fixed first. Then the slider will work perfectly.

Also, IMHO, It doesn't need to return a mouse position to grabber position. The slider will do its job if it works. ^^

@jmb462
Copy link
Contributor Author

jmb462 commented Mar 10, 2021

As a top_level control, it doesn't inherits from its parents' transform. It may cause the problem with zoomed GraphEdit.
This part is a feature of "top_level" property so I think the scale of the grabber need to be fixed with my proposal.

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.

@jmb462
Copy link
Contributor Author

jmb462 commented Mar 12, 2021

Closed this one and open the new PR for grabber zoom only #46943

@jmb462 jmb462 closed this Mar 12, 2021
@jmb462 jmb462 deleted the fix-slider-grabber-zoomed-position branch March 12, 2021 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scandal with a node slider and zoom
4 participants