aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/citra_qt
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/citra_qt
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/citra_qt')
-rw-r--r--src/citra_qt/bootmanager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp
index b81bd616..a8bff924 100644
--- a/src/citra_qt/bootmanager.cpp
+++ b/src/citra_qt/bootmanager.cpp
@@ -288,7 +288,7 @@ void GRenderWindow::mousePressEvent(QMouseEvent *event)
void GRenderWindow::mouseMoveEvent(QMouseEvent *event)
{
auto pos = event->pos();
- this->TouchMoved(static_cast<unsigned>(pos.x()), static_cast<unsigned>(pos.y()));
+ this->TouchMoved(static_cast<unsigned>(std::max(pos.x(), 0)), static_cast<unsigned>(std::max(pos.y(), 0)));
}
void GRenderWindow::mouseReleaseEvent(QMouseEvent *event)