mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-11 16:49:28 +02:00
InputCommon: Make "Cursor" inputs aware of the rendered aspect ratio.
This commit is contained in:
@ -125,9 +125,11 @@ void KeyboardMouse::UpdateCursorInput()
|
||||
const auto win_width = rect.right - rect.left;
|
||||
const auto win_height = rect.bottom - rect.top;
|
||||
|
||||
const auto window_scale = g_controller_interface.GetWindowInputScale();
|
||||
|
||||
// Convert the cursor position to a range from -1 to 1.
|
||||
m_state_in.cursor.x = ControlState(point.x) / win_width * 2 - 1;
|
||||
m_state_in.cursor.y = ControlState(point.y) / win_height * 2 - 1;
|
||||
m_state_in.cursor.x = (ControlState(point.x) / win_width * 2 - 1) * window_scale.x;
|
||||
m_state_in.cursor.y = (ControlState(point.y) / win_height * 2 - 1) * window_scale.y;
|
||||
}
|
||||
|
||||
void KeyboardMouse::UpdateInput()
|
||||
|
Reference in New Issue
Block a user