[PATCH libinput 6/6] accel_profile_smooth_simple: Make 0.0-1.0 accel range depend on threshold

Peter Hutterer peter.hutterer at who-t.net
Mon Jul 7 16:21:22 PDT 2014


From: Hans de Goede <hdegoede at redhat.com>

Instead of always going from an accel of 0.0 to 1.0 between a velocity of
0.0 and 1.0, make the lead-in length of the curve depend on the threshold
setting, using half of the threshold for the lead-in.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/filter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/filter.c b/src/filter.c
index 8192dd0..6fbd4d9 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -343,8 +343,8 @@ pointer_accel_profile_smooth_simple(struct motion_filter *filter,
 
 	velocity *= DEFAULT_CONSTANT_ACCELERATION;
 
-	if (velocity < 1.0)
-		return calc_penumbral_gradient(0.5 + velocity * 0.5) * 2.0 - 1.0;
+	if (velocity < (threshold / 2.0))
+		return calc_penumbral_gradient(0.5 + velocity / threshold) * 2.0 - 1.0;
 
 	if (velocity <= threshold)
 		return 1.0;
-- 
1.9.3



More information about the wayland-devel mailing list