[PATCH libinput] tablet: Normalization functions can return 1.0
Bill Spitzak
spitzak at gmail.com
Fri Oct 10 12:45:32 PDT 2014
---
src/evdev-tablet.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
index ff5f737..9921823 100644
--- a/src/evdev-tablet.c
+++ b/src/evdev-tablet.c
@@ -105,7 +105,7 @@ tablet_update_tool(struct tablet_dispatch *tablet,
static inline double
normalize_pressure_or_dist(const struct input_absinfo * absinfo) {
- double range = absinfo->maximum - absinfo->minimum + 1;
+ double range = absinfo->maximum - absinfo->minimum;
double value = (absinfo->value - absinfo->minimum) / range;
return value;
@@ -113,7 +113,7 @@ normalize_pressure_or_dist(const struct input_absinfo * absinfo) {
static inline double
normalize_tilt(const struct input_absinfo * absinfo) {
- double range = absinfo->maximum - absinfo->minimum + 1;
+ double range = absinfo->maximum - absinfo->minimum;
double value = (absinfo->value - absinfo->minimum) / range;
/* Map to the (-1, 1) range */
--
1.7.9.5
More information about the wayland-devel
mailing list