mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-24 20:30:04 +01:00
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:
parent
65eaabf91f
commit
d75a0fa42d
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue