Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pckbport Fix clamping of deltas so it works for both...
details: https://anonhg.NetBSD.org/src/rev/5eb0fdae4a8c
branches: trunk
changeset: 445619:5eb0fdae4a8c
user: blymn <blymn%NetBSD.org@localhost>
date: Tue Nov 06 08:55:02 2018 +0000
description:
Fix clamping of deltas so it works for both positive and negative deltas.
diffstat:
sys/dev/pckbport/synaptics.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (33 lines):
diff -r 20ef351f5b6b -r 5eb0fdae4a8c sys/dev/pckbport/synaptics.c
--- a/sys/dev/pckbport/synaptics.c Tue Nov 06 06:17:29 2018 +0000
+++ b/sys/dev/pckbport/synaptics.c Tue Nov 06 08:55:02 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: synaptics.c,v 1.42 2018/07/14 00:47:33 maya Exp $ */
+/* $NetBSD: synaptics.c,v 1.43 2018/11/06 08:55:02 blymn Exp $ */
/*
* Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
#include "opt_pms.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.42 2018/07/14 00:47:33 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.43 2018/11/06 08:55:02 blymn Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1485,10 +1485,10 @@
/*
* Clamp deltas to specified maximums.
*/
- if (dx > synaptics_max_speed_x)
- dx = synaptics_max_speed_x;
- if (dy > synaptics_max_speed_y)
- dy = synaptics_max_speed_y;
+ if (abs(dx) > synaptics_max_speed_x)
+ dx = ((dx >= 0)? 1 : -1) * synaptics_max_speed_x;
+ if (abs(dy) > synaptics_max_speed_y)
+ dy = ((dy >= 0)? 1 : -1) * synaptics_max_speed_y;
*dxp = dx;
*dyp = dy;
Home |
Main Index |
Thread Index |
Old Index