summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-07-04 16:59:50 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2014-07-09 12:40:01 +1000
commit289949d0c43e4753ecc77ee05ee2092c893f7941 (patch)
tree7261b412d1bf43783fbd1778bd9c088476345c40
parent6e8f5f28e230f849f77dd3381cf21f76c080b261 (diff)
downloadlibinput-289949d0c43e4753ecc77ee05ee2092c893f7941.tar.gz
accel_profile_smooth_simple: Make 0.0-1.0 accel range depend on threshold
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@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/filter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/filter.c b/src/filter.c
index 8192dd0c..6fbd4d91 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;