From 7cffd28e8f2de17ffe5f0bfbd9e85fc5cbc05fe0 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 16 Jan 2024 16:27:24 +1000 Subject: [PATCH] tablet: don't use absinfo_range for the percentage calculation Our percents are inclusive 0% and 100%. --- src/evdev-tablet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c index 541485f1..1a4f5df8 100644 --- a/src/evdev-tablet.c +++ b/src/evdev-tablet.c @@ -1073,7 +1073,7 @@ tool_set_bits(const struct tablet_dispatch *tablet, static inline int axis_range_percentage(const struct input_absinfo *a, double percent) { - return absinfo_range(a) * percent/100.0 + a->minimum; + return (a->maximum - a->minimum) * percent/100.0 + a->minimum; } static inline void