diff options
author | Zaneo <gareth.higgins@ryerson.ca> | 2015-04-14 00:06:44 -0400 |
---|---|---|
committer | Zaneo <gareth.higgins@ryerson.ca> | 2015-05-01 23:52:33 -0400 |
commit | b8328593fe3d60ecb066ad0959d8c1e8dfb4d3c5 (patch) | |
tree | fdeec9f5d356b84f21c92ddb4b469aedb11e93db /src/citra | |
parent | 5b9bbc37d4a64ac2ca347dc2a7ce1de9e28f0d5e (diff) |
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.
Diffstat (limited to 'src/citra')
-rw-r--r-- | src/citra/emu_window/emu_window_glfw.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<unsigned>(x), static_cast<unsigned>(y)); + GetEmuWindow(win)->TouchMoved(static_cast<unsigned>(std::max(x, 0.0)), static_cast<unsigned>(std::max(y, 0.0))); } /// Called by GLFW when a key event occurs |