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

MenuButton hover position does not scale with the scale factor multiplier #86240

Closed
OverloadedOrama opened this issue Dec 16, 2023 · 2 comments · Fixed by #86304
Closed

MenuButton hover position does not scale with the scale factor multiplier #86240

OverloadedOrama opened this issue Dec 16, 2023 · 2 comments · Fixed by #86304
Milestone

Comments

@OverloadedOrama
Copy link
Contributor

OverloadedOrama commented Dec 16, 2023

Tested versions

Reproducible in 4.2.1

System information

Godot v4.2.1.stable - openSUSE Tumbleweed 20231210 - X11 - GLES3 (Compatibility) - NVIDIA GeForce GTX 1060 6GB (nvidia) - AMD Ryzen 5 1600 Six-Core Processor (12 Threads)

Issue description

MenuBar and MenuButton's switch_on_hover property is not working properly when the scale factor multiplier is other than 1. The position the cursor needs to be in order for a PopupMenu to appear seems to be the one where the scale factor multiplier 1. In other words, the hover position is not scaling with the scale factor multiplier and remains constant. This results in a weird behavior, as seen in the below video.

2023-12-16.22-45-07.mp4

(Scale multiplier is set to 1.5 in the video)

The bigger the distance from 1, the weirder the behavior gets. Note that this also occurs when the scale is less than 1.

Interestingly, this doesn't seem to happen to the Godot editor itself.

Steps to reproduce

Create a project with a MenuBar node with PopupMenu items, or multiple MenuButtons as siblings and enable "Switch on Hover". Go to the project settings, General tab, Display, Window and set the Scale to something other than 1. Run the project, click on a menu button and move your cursor around to switch on a sibling menu button on hover. You can see that the position is wrong.

Minimal reproduction project (MRP)

MenuButtonHoverBug.zip

@Calinou
Copy link
Member

Calinou commented Dec 16, 2023

(This is a video, not sure why it isn't embedded. Scale multiplier is set to 1.5 in the video.)

Remember that for GitHub video previews to work, you need to have a blank line before and after the video URL.

@OverloadedOrama
Copy link
Contributor Author

(This is a video, not sure why it isn't embedded. Scale multiplier is set to 1.5 in the video.)

Remember that for GitHub video previews to work, you need to have a blank line before and after the video URL.

Oops, fixed it! Thanks for letting me know.

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