mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-10 18:07:57 -05:00
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.
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user