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:
parent
721d16ff30
commit
c81d19aaf6
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue