tablet: fix the tilt range being off by one

Kernel ranges are inclusiv min/max, so let's make sure we calculate that
correctly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2023-08-28 09:02:21 +10:00 committed by José Expósito
parent 65eaabf91f
commit d75a0fa42d

View file

@ -374,7 +374,7 @@ normalize_pressure(const struct input_absinfo *absinfo,
static inline double
adjust_tilt(const struct input_absinfo *absinfo)
{
double range = absinfo->maximum - absinfo->minimum;
double range = absinfo->maximum - absinfo->minimum + 1;
double value = (absinfo->value - absinfo->minimum) / range;
const int WACOM_MAX_DEGREES = 64;