Fix cursor locked mode when system uses Dpi scaling

This commit is contained in:
Wojtek Figat
2025-04-17 13:27:59 +02:00
parent 7e72d7b3cf
commit 3d454ed321

View File

@@ -1206,7 +1206,9 @@ void InputService::Update()
const auto lockMode = Screen::GetCursorLock();
if (lockMode == CursorLockMode::Locked)
{
Input::SetMousePosition(Screen::GetSize() * 0.5f);
const Float2 pos = Screen::ScreenToGameViewport(Screen::GetSize() * 0.5f) -
Screen::ScreenToGameViewport(Float2::Zero);
Input::SetMousePosition(pos);
}
// Send events for the active actions and axes (send events only in play mode)