diff options
author | Chris Xiong <chirs241097@gmail.com> | 2021-05-30 00:30:43 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2021-05-30 00:30:43 +0800 |
commit | d429de6a282ce17f04bacfa3a0c855fc0682851b (patch) | |
tree | b4727e6119e4214eb77271f9a4f0556fe29db577 /visualization/qmpvisualization.cpp | |
parent | 27a695e669b3074bb2a7dcf08553d5070a20ff05 (diff) | |
download | QMidiPlayer-d429de6a282ce17f04bacfa3a0c855fc0682851b.tar.xz |
Control the 3D viewport in a more sane way.
No more random viewport resets for real this time.
Diffstat (limited to 'visualization/qmpvisualization.cpp')
-rw-r--r-- | visualization/qmpvisualization.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/visualization/qmpvisualization.cpp b/visualization/qmpvisualization.cpp index 763ab4f..3dc0324 100644 --- a/visualization/qmpvisualization.cpp +++ b/visualization/qmpvisualization.cpp @@ -186,6 +186,7 @@ void qmpVisualization::showThread() debug = false; ctk = api->getCurrentTimeStamp(); lst = std::chrono::steady_clock::now(); + sm->smSetMouseGrab(false); sm->smMainLoop(); sm->smFinale(); } @@ -327,8 +328,10 @@ void qmpVisualization::updateVisualization3D() { float x, y; sm->smGetMouse2f(&x, &y); - rot[1] -= (y - lasty) * 0.01; - rot[2] += (x - lastx) * 0.01; + rot[1] -= (y - lasty) * 0.1; + rot[2] += (x - lastx) * 0.1; + lastx = x; + lasty = y; while (rot[1] > 360) rot[1] -= 360; while (rot[1] < 0) |