tablet: don't use absinfo_range for the percentage calculation

Our percents are inclusive 0% and 100%.
This commit is contained in:
Peter Hutterer 2024-01-16 16:27:24 +10:00
parent 0322403ea4
commit 7cffd28e8f

View file

@ -1073,7 +1073,7 @@ tool_set_bits(const struct tablet_dispatch *tablet,
static inline int static inline int
axis_range_percentage(const struct input_absinfo *a, double percent) 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 static inline void