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

Change Window::physical_cursor_position to use the physical size of the window #9657

Merged

Conversation

ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Aug 31, 2023

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.

…tion is inside the window but it constructs the bounding rect for the window using its logical size and then checks to see if the cursor's physical position in inside the rect. 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.

This commit changes the rect so it's the physical size.
@ickshonpe ickshonpe changed the title Window::physical_cursor_position checks to see if the cursor's posi… Change Window::physical_cursor_position to use the physical size of the window Aug 31, 2023
Copy link
Contributor

@rparrett rparrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me / seems to fix the issue.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Input Player input via keyboard, mouse, gamepad, and more A-Windowing Platform-agnostic interface layer to run your app in labels Aug 31, 2023
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Aug 31, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Aug 31, 2023
Merged via the queue into bevyengine:main with commit 11567b3 Aug 31, 2023
26 checks passed
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request 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-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI Focus not working properly with non-1.0 scale factors
3 participants