[PATCH libinput 1/2] filter: change the tracker delta type to device-units
Hans de Goede
hdegoede at redhat.com
Thu Jan 19 09:22:28 UTC 2017
Hi,
On 19-01-17 03:34, Peter Hutterer wrote:
> We were just switching type here without actual normalization, the filter code
> is in device units as of bdd4264d6150f4a6248eec7.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
Series looks good to me:
Reviewed-by: Hans de Goede <hdegoede at redhat.com>
Regards,
Hans
> ---
> src/filter.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/filter.c b/src/filter.c
> index d7a1515..3035234 100644
> --- a/src/filter.c
> +++ b/src/filter.c
> @@ -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
>
More information about the wayland-devel
mailing list