mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-31 17:00:09 +01:00
filter: fix acceleration threshold assignment
The new values were in units/us and didn't make the switch back to ms in
8a6825f160.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
parent
317cd252be
commit
254f87564f
1 changed files with 4 additions and 3 deletions
|
|
@ -78,6 +78,7 @@ filter_get_speed(struct motion_filter *filter)
|
|||
*/
|
||||
|
||||
#define DEFAULT_THRESHOLD 0.4 /* in units/ms */
|
||||
#define MINIMUM_THRESHOLD 0.2 /* in units/ms */
|
||||
#define DEFAULT_ACCELERATION 2.0 /* unitless factor */
|
||||
#define DEFAULT_INCLINE 1.1 /* unitless factor */
|
||||
|
||||
|
|
@ -333,9 +334,9 @@ accelerator_set_speed(struct motion_filter *filter,
|
|||
assert(speed >= -1.0 && speed <= 1.0);
|
||||
|
||||
/* delay when accel kicks in */
|
||||
accel_filter->threshold = DEFAULT_THRESHOLD - speed / 4000.0;
|
||||
if (accel_filter->threshold < 0.0002)
|
||||
accel_filter->threshold = 0.0002;
|
||||
accel_filter->threshold = DEFAULT_THRESHOLD - speed / 4.0;
|
||||
if (accel_filter->threshold < MINIMUM_THRESHOLD)
|
||||
accel_filter->threshold = MINIMUM_THRESHOLD;
|
||||
|
||||
/* adjust max accel factor */
|
||||
accel_filter->accel = DEFAULT_ACCELERATION + speed * 1.5;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue