Change Window::physical_cursor_position to use the physical size of 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.
This commit is contained in:
ickshonpe 2023-08-31 20:02:33 +01:00 committed by GitHub
parent ee3cc8ca86
commit 11567b31f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -330,7 +330,14 @@ impl Window {
match self.internal.physical_cursor_position {
Some(position) => {
let position = position.as_vec2();
if Rect::new(0., 0., self.width(), self.height()).contains(position) {
if Rect::new(
0.,
0.,
self.physical_width() as f32,
self.physical_height() as f32,
)
.contains(position)
{
Some(position)
} else {
None