From 58cd23d1acfc805f92f2aafecbe3736e6ef80989 Mon Sep 17 00:00:00 2001 From: Markus Siglreithmaier Date: Thu, 2 Jun 2022 19:08:54 +0200 Subject: [PATCH] On Windows, fix reported cursor position. (#2311) When clicking and moving the cursor out of the window negative coordinates were not handled correctly. --- src/platform_impl/windows/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform_impl/windows/mod.rs b/src/platform_impl/windows/mod.rs index 5c3a01b9..85830bc5 100644 --- a/src/platform_impl/windows/mod.rs +++ b/src/platform_impl/windows/mod.rs @@ -106,13 +106,13 @@ const fn get_xbutton_wparam(x: u32) -> u16 { } #[inline(always)] -const fn get_x_lparam(x: u32) -> u16 { - loword(x) +const fn get_x_lparam(x: u32) -> i16 { + loword(x) as _ } #[inline(always)] -const fn get_y_lparam(x: u32) -> u16 { - hiword(x) +const fn get_y_lparam(x: u32) -> i16 { + hiword(x) as _ } #[inline(always)]