aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/common/emu_window.h
diff options
context:
space:
mode:
authorGravatar Zaneo <gareth.higgins@ryerson.ca>2015-04-14 00:06:44 -0400
committerGravatar Zaneo <gareth.higgins@ryerson.ca>2015-05-01 23:52:33 -0400
commitb8328593fe3d60ecb066ad0959d8c1e8dfb4d3c5 (patch)
treefdeec9f5d356b84f21c92ddb4b469aedb11e93db /src/common/emu_window.h
parent5b9bbc37d4a64ac2ca347dc2a7ce1de9e28f0d5e (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/common/emu_window.h')
-rw-r--r--src/common/emu_window.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/emu_window.h b/src/common/emu_window.h
index c8e2de04..e0fc12a4 100644
--- a/src/common/emu_window.h
+++ b/src/common/emu_window.h
@@ -206,5 +206,10 @@ private:
u16 touch_x; ///< Touchpad X-position in native 3DS pixel coordinates (0-320)
u16 touch_y; ///< Touchpad Y-position in native 3DS pixel coordinates (0-240)
+ /**
+ * Clip the provided coordinates to be inside the touchscreen area.
+ */
+ std::tuple<unsigned,unsigned> ClipToTouchScreen(unsigned new_x, unsigned new_y);
+
Service::HID::PadState pad_state;
};