From 16f4ebab9ca5a1a65bb53a77b406a2fafea52415 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 3 Sep 2024 00:45:40 +0200 Subject: [PATCH] Mouse: Fix the if blocks in mouse_subtract_z(). --- src/device/mouse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/device/mouse.c b/src/device/mouse.c index fc193398b..604109668 100644 --- a/src/device/mouse.c +++ b/src/device/mouse.c @@ -482,10 +482,10 @@ mouse_subtract_z(int *delta_z, int min, int max, int invert) int z = atomic_load(&mouse_z); int real_z = invert ? -z : z; - if (mouse_z > max) { + if (real_z > max) { *delta_z = max; real_z -= max; - } else if (mouse_z < min) { + } else if (real_z < min) { *delta_z = min; real_z += ABS(min); } else {