From c81d19aaf68381166dc1a6fcaee159b35ca65c10 Mon Sep 17 00:00:00 2001 From: Rongrong Date: Tue, 26 May 2026 02:27:10 +0800 Subject: [PATCH] rules: MouseScroll: Round to zero for signed values Rounding to negative infinity makes no sense for the purpose here. While the current code path probably won't run into a mistaken scroll amount as no rule component returns a floating point number, let's fix this as my radar beeped too. Signed-off-by: Rongrong --- lib/logitech_receiver/diversion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/logitech_receiver/diversion.py b/lib/logitech_receiver/diversion.py index dc76df2a..87dd727c 100644 --- a/lib/logitech_receiver/diversion.py +++ b/lib/logitech_receiver/diversion.py @@ -1232,7 +1232,7 @@ class MouseScroll(Action): def evaluate(self, feature, notification: HIDPPNotification, device, last_result): amounts = self.amounts if is_number(last_result): - amounts = [math.floor(last_result * a) for a in self.amounts] + amounts = [math.trunc(last_result * a) for a in self.amounts] if logger.isEnabledFor(logging.INFO): logger.info("MouseScroll action: %s %s %s", self.amounts, last_result, amounts) dx, dy = amounts