From 99e72b979d7f9f45e264ff30fc2964c75bd47072 Mon Sep 17 00:00:00 2001 From: Virt <41426325+VirtCode@users.noreply.github.com> Date: Sat, 29 Jun 2024 15:38:59 +0200 Subject: [PATCH] fix: clamp angles to 0 below threshold --- src/cursor.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cursor.cpp b/src/cursor.cpp index 648af7b..60018df 100644 --- a/src/cursor.cpp +++ b/src/cursor.cpp @@ -269,8 +269,13 @@ void CDynamicCursors::calculate(EModeUpdate type) { std::abs(this->angle - angle) > ((PI / 180) * **PTHRESHOLD) || this->zoom - zoom != 0 // we don't have a threshold here as this will not happen that often ) { - this->zoom = zoom; - this->angle = angle; + this->zoom = zoom; + this->angle = angle; + + // clamp to zero at low angles, so that the normal position in tilt looks fine (and actually is 0) + if (std::abs(this->angle) < ((PI / 180) * **PTHRESHOLD)) + this->angle = 0; + // lock software cursors if zooming if (zoom > 1) {