mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-08 23:00:33 +01:00
filter: add a comment for how we calculate velocity
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
5016dcd012
commit
0e8be12383
1 changed files with 7 additions and 0 deletions
|
|
@ -228,6 +228,13 @@ calculate_velocity_after_timeout(struct pointer_tracker *tracker)
|
|||
tracker->time + MOTION_TIMEOUT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the velocity based on the tracker data. Velocity is averaged
|
||||
* across multiple historical values, provided those values aren't "too
|
||||
* different" to our current one. That includes either being too far in the
|
||||
* past, moving into a different direction or having too much of a velocity
|
||||
* change between events.
|
||||
*/
|
||||
static double
|
||||
calculate_velocity(struct pointer_accelerator *accel, uint64_t time)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue