From: Hans de Goede Date: Fri, 4 Jul 2014 15:17:14 +0000 (+0200) Subject: accel_profile_smooth_simple: Fix jump in acceleration curve X-Git-Tag: 0.5.0~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6e8f5f28e230f849f77dd3381cf21f76c080b261;p=platform%2Fupstream%2Flibinput.git 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 Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- 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)); }