mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-25 03:30:05 +01:00
filter: change the tracker delta type to device-units
We were just switching type here without actual normalization, the filter code
is in device units as of bdd4264d61.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
8660c19f71
commit
79339bca9c
1 changed files with 2 additions and 2 deletions
|
|
@ -156,7 +156,7 @@ filter_get_type(struct motion_filter *filter)
|
|||
#define NUM_POINTER_TRACKERS 16
|
||||
|
||||
struct pointer_tracker {
|
||||
struct normalized_coords delta; /* delta to most recent event */
|
||||
struct device_float_coords delta; /* delta to most recent event */
|
||||
uint64_t time; /* us */
|
||||
uint32_t dir;
|
||||
};
|
||||
|
|
@ -230,7 +230,7 @@ static double
|
|||
calculate_tracker_velocity(struct pointer_tracker *tracker, uint64_t time)
|
||||
{
|
||||
double tdelta = time - tracker->time + 1;
|
||||
return normalized_length(tracker->delta) / tdelta; /* units/us */
|
||||
return hypot(tracker->delta.x, tracker->delta.y) / tdelta; /* units/us */
|
||||
}
|
||||
|
||||
static inline double
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue