We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7418188 commit 9553861Copy full SHA for 9553861
qmlfrontend/game_view.cpp
@@ -72,9 +72,11 @@ void GameView::sync() {
72
}
73
74
if (m_engineInstance) {
75
- QPoint mousePos = mapFromGlobal(QCursor::pos()).toPoint();
76
- m_engineInstance->moveCamera(mousePos - m_centerPoint);
77
- QCursor::setPos(mapToGlobal(m_centerPoint).toPoint());
+ const auto delta = mapFromGlobal(QCursor::pos()).toPoint() - m_centerPoint;
+
+ m_engineInstance->moveCamera(delta);
78
79
+ QCursor::setPos(window()->screen(), mapToGlobal(m_centerPoint).toPoint());
80
81
82
if (m_renderer) {
0 commit comments