commit eae53cf8fb48ee5c32409fc511ad69dab7f1b980
parent 03b66a01b2c3e00b40087cd7ebbf1caa8d75f966
Author: Lauri Hakkarainen <bionik@gmail.com>
Date: Mon, 13 Feb 2017 09:50:00 +0100
Limited angles of rotation between 0 and 360 degrees
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/canvas.cpp b/src/canvas.cpp
@@ -162,8 +162,8 @@ void Canvas::mouseMoveEvent(QMouseEvent* event)
if (event->buttons() & Qt::LeftButton)
{
- yaw = yaw - d.x();
- tilt = tilt - d.y();
+ yaw = fmod(yaw - d.x(), 360);
+ tilt = fmod(tilt - d.y(), 360);
update();
}
else if (event->buttons() & Qt::RightButton)