|
|
|
@ -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; |
|
|
|
|