mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-11 14:58:41 -05:00
input_common: Fix mouse panning behaivour
This commit is contained in:
@ -411,8 +411,9 @@ void GRenderWindow::mousePressEvent(QMouseEvent* event) {
|
||||
if (event->source() == Qt::MouseEventSynthesizedBySystem) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto pos = event->pos();
|
||||
// Qt sometimes returns the parent coordinates. To avoid this we read the global mouse
|
||||
// coordinates and map them to the current render area
|
||||
const auto pos = mapFromGlobal(QCursor::pos());
|
||||
const auto [x, y] = ScaleTouch(pos);
|
||||
const auto button = QtButtonToMouseButton(event->button());
|
||||
input_subsystem->GetMouse()->PressButton(x, y, button);
|
||||
@ -429,7 +430,9 @@ void GRenderWindow::mouseMoveEvent(QMouseEvent* event) {
|
||||
if (event->source() == Qt::MouseEventSynthesizedBySystem) {
|
||||
return;
|
||||
}
|
||||
auto pos = event->pos();
|
||||
// Qt sometimes returns the parent coordinates. To avoid this we read the global mouse
|
||||
// coordinates and map them to the current render area
|
||||
const auto pos = mapFromGlobal(QCursor::pos());
|
||||
const auto [x, y] = ScaleTouch(pos);
|
||||
const int center_x = width() / 2;
|
||||
const int center_y = height() / 2;
|
||||
|
Reference in New Issue
Block a user