1
0
Fork 0

treat WM_MOUSEMOVE coordinates as i16 to handle negative coordinates properly

This commit is contained in:
Micah Johnston 2020-12-20 15:33:52 -06:00
parent cc6ead3669
commit d138cfaccf

View file

@ -71,8 +71,8 @@ unsafe extern "system" fn wnd_proc(
match msg {
WM_MOUSEMOVE => {
let x = (lparam & 0xFFFF) as i32;
let y = ((lparam >> 16) & 0xFFFF) as i32;
let x = (lparam & 0xFFFF) as i16 as i32;
let y = ((lparam >> 16) & 0xFFFF) as i16 as i32;
let physical_pos = PhyPoint { x, y };