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 <i@rong.moe>
This commit is contained in:
Rongrong 2026-06-18 00:25:18 +08:00
parent 3f03b833b9
commit f7cb2f9a40
No known key found for this signature in database
GPG Key ID: 1C2D45D45AB7FE94
1 changed files with 1 additions and 1 deletions

View File

@ -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