From f20eefbc5924c1d2d3da56fd3351668fc17beab9 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 16 Jan 2024 14:29:56 +1000 Subject: [PATCH] Revert "tablet: fix the pressure offset range being off by one" Fixing the range is only required when the output range is not inclusive of the min/max (such as when mapping an abs axis to a screen width). Our pressure range is inclusive 0.0 and 1.0, so we want absinfo->maximum to map to exactly 1.0 This reverts commit a5b6f4009bdcac3ec0359568c40cbb3a6bdf4609. --- 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 e42bd5fe..8d722ad8 100644 --- a/src/evdev-tablet.c +++ b/src/evdev-tablet.c @@ -364,7 +364,7 @@ normalize_pressure(const struct input_absinfo *absinfo, * threshold is 0 pressure. */ int base = tool->pressure.threshold.lower; - double range = absinfo->maximum - base + 1; + double range = absinfo->maximum - base; double value = (absinfo->value - base) / range; return max(0.0, value);