mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-03 18:10:28 +01:00
tablet: fix the pressure offset 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
d75a0fa42d
commit
a5b6f4009b
1 changed files with 1 additions and 1 deletions
|
|
@ -365,7 +365,7 @@ normalize_pressure(const struct input_absinfo *absinfo,
|
|||
* threshold is 0 pressure.
|
||||
*/
|
||||
int base = tool->pressure.threshold.lower;
|
||||
double range = absinfo->maximum - base;
|
||||
double range = absinfo->maximum - base + 1;
|
||||
double value = (absinfo->value - base) / range;
|
||||
|
||||
return max(0.0, value);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue