aboutsummaryrefslogtreecommitdiff
path: root/visualization/qmpvisualization.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2021-05-30 00:30:43 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2021-05-30 00:30:43 +0800
commitd429de6a282ce17f04bacfa3a0c855fc0682851b (patch)
treeb4727e6119e4214eb77271f9a4f0556fe29db577 /visualization/qmpvisualization.cpp
parent27a695e669b3074bb2a7dcf08553d5070a20ff05 (diff)
downloadQMidiPlayer-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.cpp7
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)