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

UI Focus not working properly with non-1.0 scale factors #9656

Closed
rparrett opened this issue Aug 31, 2023 · 0 comments · Fixed by #9657
Closed

UI Focus not working properly with non-1.0 scale factors #9656

rparrett opened this issue Aug 31, 2023 · 0 comments · Fixed by #9657
Labels
A-Input Player input via keyboard, mouse, gamepad, and more A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior

Comments

@rparrett
Copy link
Contributor

rparrett commented Aug 31, 2023

Bevy version

main
bisected to: #8855

Relevant system information

AdapterInfo { name: "Apple M1 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
SystemInfo { os: "MacOS 13.4.1 ", kernel: "22.5.0", cpu: "Apple M1 Max", core_count: "10", memory: "64.0 GiB" }

What you did

  • Have screen with scale_factor != 1.0 or set a scale_factor_override.
  • cargo run --example button
  • Test focus state by moving mouse near the button's boundaries

What went wrong

Button does not show appropriate focus state. Focus boundaries seem to be different from displayed button boundaries.

buttonbad

Additional information

This was noticed in #9637 but is unrelated.

@rparrett rparrett added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled A-Input Player input via keyboard, mouse, gamepad, and more A-UI Graphical user interfaces, styles, layouts, and widgets and removed S-Needs-Triage This issue needs to be labelled labels Aug 31, 2023
github-merge-queue bot pushed a commit that referenced this issue Aug 31, 2023
… the window (#9657)

# Objective

`Window::physical_cursor_position` checks to see if the cursor's
position is inside the window but it constructs the bounding rect for
the window using its logical size and then checks to see if it contains
the cursor's physical position. When the physical size is smaller than
the logical size, this leaves a dead zone where the cursor is over the
window but its position is unreported.

fixes: #9656

## Solution

Use the physical size of the window.
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this issue Jan 9, 2024
… the window (bevyengine#9657)

# Objective

`Window::physical_cursor_position` checks to see if the cursor's
position is inside the window but it constructs the bounding rect for
the window using its logical size and then checks to see if it contains
the cursor's physical position. When the physical size is smaller than
the logical size, this leaves a dead zone where the cursor is over the
window but its position is unreported.

fixes: bevyengine#9656

## Solution

Use the physical size of the window.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Input Player input via keyboard, mouse, gamepad, and more A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant