diff options
author | Hans de Goede <hdegoede@redhat.com> | 2014-07-04 17:17:14 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2014-07-09 12:40:01 +1000 |
commit | 6e8f5f28e230f849f77dd3381cf21f76c080b261 (patch) | |
tree | 0ff9c3c5941e353faccba173a2a6245b98dbe079 | |
parent | 4da6dd52a433e8ba0a954a0e36bc653cf86651bd (diff) | |
download | libinput-6e8f5f28e230f849f77dd3381cf21f76c080b261.tar.gz |
accel_profile_smooth_simple: Fix jump in acceleration curve
There was an error in the value passed to the second calc_penumbral_gradient
call causing a jump in the acceleration curve. This commit fixes this.
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.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/filter.c b/src/filter.c index 487669c5..8192dd0c 100644 --- a/src/filter.c +++ b/src/filter.c @@ -353,6 +353,8 @@ pointer_accel_profile_smooth_simple(struct motion_filter *filter, if (velocity >= accel) return accel; - smooth_accel_coefficient = calc_penumbral_gradient(velocity / accel); + /* Velocity is between 1.0 and accel, scale this to 0.0 - 1.0 */ + velocity = (velocity - 1.0) / (accel - 1.0); + smooth_accel_coefficient = calc_penumbral_gradient(velocity); return 1.0 + (smooth_accel_coefficient * (accel - 1.0)); } |