mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-28 07:20:06 +01:00
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>
This commit is contained in:
parent
4da6dd52a4
commit
6e8f5f28e2
1 changed files with 3 additions and 1 deletions
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue