Merge pull request #11397 from TellowKrinkle/QuartzMousePos
InputCommon:QuartzKB&M: Fix mouse y coordinates
This commit is contained in:
commit
d949aa60bb
|
@ -259,16 +259,14 @@ void KeyboardAndMouse::UpdateInput()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CGEventRef event = CGEventCreate(nil);
|
NSPoint loc = [NSEvent mouseLocation];
|
||||||
CGPoint loc = CGEventGetLocation(event);
|
|
||||||
CFRelease(event);
|
|
||||||
|
|
||||||
const auto window_scale = g_controller_interface.GetWindowInputScale();
|
const auto window_scale = g_controller_interface.GetWindowInputScale();
|
||||||
|
|
||||||
loc.x -= bounds.origin.x;
|
loc.x -= bounds.origin.x;
|
||||||
loc.y -= bounds.origin.y;
|
loc.y -= bounds.origin.y;
|
||||||
m_cursor.x = (loc.x / window_width * 2 - 1.0) * window_scale.x;
|
m_cursor.x = (loc.x / window_width * 2 - 1.0) * window_scale.x;
|
||||||
m_cursor.y = (loc.y / window_height * 2 - 1.0) * window_scale.y;
|
m_cursor.y = (loc.y / window_height * 2 - 1.0) * -window_scale.y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue