mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-26 04:00:05 +01:00
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>
This commit is contained in:
parent
6e8f5f28e2
commit
289949d0c4
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue