Strange behavior of `MouseEvent`
Closed this issue · 1 comments
yujincheng08 commented
Hi, I am currently debugging this project on MACOS to make it work. So far so good, but I encounter a problem with the MouseEvent
.
The current Behavior:
- The
screen_width x screen_height
is defined as1280 x 720
. - When launched without fullscreen, the
device_width x device_height
is defined as2560 x 1440
. Thus thescreen_scale_ratio
is0.5
. And the mouse event's coordinate (without being scaled byscreen_scale_ratio
) is under1280 x 720
. - When enter the fullscreen mode, the the
device_width x device_height
is defined as5120 x 2880
. Thus thescreen_scale_ratio
is0.25
. And the mouse event's coordinate (without being scaled byscreen_scale_ratio
) is under2560 x 1440
.
The mouse event's coordinate is not aligned with the screen_wight, screen_height
or device_width, device_height
. I wonder what's going on with the MouseEvent
.
yujincheng08 commented
Oh I know what's going on, the MouseEvent
is always following SDL_GetWindowSize(window, &width, &height);
.