YuriSizuku/OnscripterYuri

Strange behavior of `MouseEvent`

Closed this issue · 1 comments

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 as 1280 x 720.
  • When launched without fullscreen, the device_width x device_height is defined as 2560 x 1440. Thus the screen_scale_ratio is 0.5. And the mouse event's coordinate (without being scaled by screen_scale_ratio) is under 1280 x 720.
  • When enter the fullscreen mode, the the device_width x device_height is defined as 5120 x 2880. Thus the screen_scale_ratio is 0.25. And the mouse event's coordinate (without being scaled by screen_scale_ratio) is under 2560 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.

Oh I know what's going on, the MouseEvent is always following SDL_GetWindowSize(window, &width, &height);.