From a270b9328ec487bee8bf08987070e50ced41594b Mon Sep 17 00:00:00 2001 From: thefiddler Date: Tue, 6 May 2014 09:31:35 +0200 Subject: [PATCH] [SDL] Report mouse in client coordinates --- Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs b/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs index dc23266..3bfc54e 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs @@ -274,8 +274,10 @@ namespace OpenTK.Platform.SDL2 static void ProcessMouseMotionEvent(Sdl2NativeWindow window, MouseMotionEvent ev) { - //float scale = window.ClientSize.Width / (float)window.Size.Width; - window.OnMouseMove(ev.X, ev.Y); + float scale = window.ClientSize.Width / (float)window.Size.Width; + window.OnMouseMove( + (int)Math.Round(ev.X * scale), + (int)Math.Round(ev.Y * scale)); } static void ProcessMouseWheelEvent(Sdl2NativeWindow window, MouseWheelEvent ev) -- 2.7.4