From ee5f66775a27f7055a4a3a80b5792d608c0fb758 Mon Sep 17 00:00:00 2001 From: Virt <41426325+VirtCode@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:53:06 +0200 Subject: [PATCH] fix: show cursor in certain rotate edge cases this fixes another NaN caused in cases where the `end` vector of the rotate mode is at y = 0. this might be caused by various factors, notably again when the cursor starts at 0;0 thanks again @RGBCube --- src/mode/ModeRotate.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mode/ModeRotate.cpp b/src/mode/ModeRotate.cpp index fc26983..be25804 100644 --- a/src/mode/ModeRotate.cpp +++ b/src/mode/ModeRotate.cpp @@ -34,6 +34,8 @@ SModeResult CModeRotate::update(Vector2D pos) { angle += PI; angle += offset * ((2 * PI) / 360); // convert to radiants + if (end.y == 0) angle = 0; // do not divide by 0 above, leave untransformed in these cases + // translate back end.x += pos.x; end.y += pos.y;