ppy / osu-framework

A game framework written with osu! in mind.
MIT License
1.67k stars 420 forks source link

Factor window scale in `UserInputManager.mouseOutsideAllDisplays` #6432

Open Susko3 opened 1 day ago

Susko3 commented 1 day ago

The mouse position is in pixel/client coordinates, while window and displays positions are in window coordinates.

Proof of coordinate spaces for display position (on a 3456x2234 macbook):

image

(Image taken from https://discord.com/channels/188630481301012481/188630652340404224/1308162379045011506)


We should probably have IWindow.ClientToDisplay(Vector2) that takes in a client (game screen space) vector and converts it to display coordinates. Would the need for ISDLWindow type checks from this code.

frenzibyte commented 1 day ago

We should probably have IWindow.ClientToDisplay(Vector2) that takes in a client (game screen space) vector and converts it to display coordinates. Would the need for ISDLWindow type checks from this code.

We already have PointToClient/PointToScreen but those are unimplemented on non-Windows platforms (and they heavily lack documentation and clarification on how they even work, and there's also this which is funny at this point).

frenzibyte commented 17 hours ago

Auto merge is borked (android CI is dead and it's marked as required), to be manually merged by anyone.