mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-03-29 18:06:52 +00:00
[SDL] Report mouse in client coordinates
This commit is contained in:
parent
7e86d349d2
commit
a270b9328e
|
@ -274,8 +274,10 @@ namespace OpenTK.Platform.SDL2
|
||||||
|
|
||||||
static void ProcessMouseMotionEvent(Sdl2NativeWindow window, MouseMotionEvent ev)
|
static void ProcessMouseMotionEvent(Sdl2NativeWindow window, MouseMotionEvent ev)
|
||||||
{
|
{
|
||||||
//float scale = window.ClientSize.Width / (float)window.Size.Width;
|
float scale = window.ClientSize.Width / (float)window.Size.Width;
|
||||||
window.OnMouseMove(ev.X, ev.Y);
|
window.OnMouseMove(
|
||||||
|
(int)Math.Round(ev.X * scale),
|
||||||
|
(int)Math.Round(ev.Y * scale));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ProcessMouseWheelEvent(Sdl2NativeWindow window, MouseWheelEvent ev)
|
static void ProcessMouseWheelEvent(Sdl2NativeWindow window, MouseWheelEvent ev)
|
||||||
|
|
Loading…
Reference in a new issue