From c13f556db0f1bbb83eb80c5ae8226e7131e69928 Mon Sep 17 00:00:00 2001 From: tobhe Date: Fri, 23 Oct 2020 21:23:59 +0000 Subject: 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@ --- sys/dev/usb/utpms.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys') 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; } } -- cgit v1.2.3