diff options
author | tobhe <tobhe@cvs.openbsd.org> | 2020-10-23 21:23:59 +0000 |
---|---|---|
committer | tobhe <tobhe@cvs.openbsd.org> | 2020-10-23 21:23:59 +0000 |
commit | c13f556db0f1bbb83eb80c5ae8226e7131e69928 (patch) | |
tree | 91cadc99b279b0988c2ea4cf6911a6591d684af1 /sys | |
parent | ec59766c422cf18ad985e282ae63b61f9f14a358 (diff) |
Subtract threshold from absolute position to allow absolute pointer
movement smaller than threshold. Fixes an issue where the pointer
sometimes jumped a few pixels.
ok bluhm@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/utpms.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/utpms.c b/sys/dev/usb/utpms.c index e589c59040c..77f5abb1b76 100644 --- a/sys/dev/usb/utpms.c +++ b/sys/dev/usb/utpms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utpms.c,v 1.10 2020/09/11 19:18:01 tobhe Exp $ */ +/* $OpenBSD: utpms.c,v 1.11 2020/10/23 21:23:58 tobhe Exp $ */ /* * Copyright (c) 2005, Johan Wallén @@ -638,8 +638,8 @@ detect_pos(int *sensors, int n_sensors, int threshold, int fact, if (sensors[i] >= threshold) { if (i == 0 || sensors[i - 1] < threshold) *fingers_ret += 1; - s += sensors[i]; - w += sensors[i] * i; + s += sensors[i] - threshold; + w += (sensors[i] - threshold) * i; } } |