From b8328593fe3d60ecb066ad0959d8c1e8dfb4d3c5 Mon Sep 17 00:00:00 2001 From: Zaneo Date: Tue, 14 Apr 2015 00:06:44 -0400 Subject: EmuWindow: Clip mouse input coordinates to emulated screen dimensions. If the mouse position for a mouse move/drag would take it outside the emulated screen dimensions, clip the coordinates to the emulated screen dimensions. Qt and GLFW will report negative coordinates for mouse positions to the left, or above citra window. Added restriction to mouse coordinates passed to touchmoved by Qt/GLFW to be greater or equal to zero. --- src/citra/emu_window/emu_window_glfw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/citra') diff --git a/src/citra/emu_window/emu_window_glfw.cpp b/src/citra/emu_window/emu_window_glfw.cpp index 997e3bc7..f879ee7c 100644 --- a/src/citra/emu_window/emu_window_glfw.cpp +++ b/src/citra/emu_window/emu_window_glfw.cpp @@ -31,7 +31,7 @@ void EmuWindow_GLFW::OnMouseButtonEvent(GLFWwindow* win, int button, int action, } void EmuWindow_GLFW::OnCursorPosEvent(GLFWwindow* win, double x, double y) { - GetEmuWindow(win)->TouchMoved(static_cast(x), static_cast(y)); + GetEmuWindow(win)->TouchMoved(static_cast(std::max(x, 0.0)), static_cast(std::max(y, 0.0))); } /// Called by GLFW when a key event occurs -- cgit v1.2.3