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

Using mouse click + drag to change values in inspector numeric properties teleports mouse to top left of screen #48971

Closed
EricEzaM opened this issue May 22, 2021 · 3 comments · Fixed by #48980

Comments

@EricEzaM
Copy link
Contributor

Godot version:
master 78861fd

OS/device including version:
WIN 10

Issue description:
As title

Steps to reproduce:
Click and drag on a number property in the inspector - your mouse disappears. When you let go, your mouse appears in the top left corner of the Godot window (position 0,0)

Note if you do the same thing on a property which has a slider bar (e.g. the rotation in the below gif) the mouse is not teleported, but still disappears.

Xw2q7inf0Z.mp4
@EricEzaM EricEzaM changed the title Using mouse click + drag to change values in inspector teleports mouse to top left of screen Using mouse click + drag to change values in inspector numeric properties teleports mouse to top left of screen May 22, 2021
@EricEzaM EricEzaM added this to the 4.0 milestone May 22, 2021
@EricEzaM
Copy link
Contributor Author

When the mouse is released, the mouse position is warped to grabbing_spinner_mouse_pos, but this value is only updated when the spinner is visible, as shown below:

} else if (!hide_slider) {
int grabber_w = 4 * EDSCALE;
int width = get_size().width - sb->get_minimum_size().width - grabber_w;
int ofs = sb->get_offset().x;
int svofs = (get_size().height + vofs) / 2 - 1;
Color c = fc;
c.a = 0.2;
draw_rect(Rect2(ofs, svofs + 1, width, 2 * EDSCALE), c);
int gofs = get_as_ratio() * width;
c.a = 0.9;
Rect2 grabber_rect = Rect2(ofs + gofs, svofs + 1, grabber_w, 2 * EDSCALE);
draw_rect(grabber_rect, c);
grabbing_spinner_mouse_pos = get_global_position() + grabber_rect.position + grabber_rect.size * 0.5;

The value also needs to be updated when the slider is hidden.

@EricEzaM
Copy link
Contributor Author

Marking as Junior Job, as I think it might be a reasonably simple fix. If you want to try solve this but have questions hit me up.

@KoBeWi
Copy link
Member

KoBeWi commented May 22, 2021

This might be regression from #48444
I moved the variable update, but maybe it should update in both places...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants