diff options
author | Hans de Goede <hdegoede@redhat.com> | 2015-03-25 15:05:19 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2015-03-27 14:44:36 +0100 |
commit | 254f4f255f1c825bcfc192b2e68d288baf49a40f (patch) | |
tree | 933b0da43b9f50855c6cfddcd4ee0321788d1001 /src/filter.c | |
parent | 209215946b90c76d6ae8cb87bd56a1210d3e5575 (diff) |
Change vector_get_direction input to a normalized_coords struct
Change vector_get_direction input to a normalized_coords type rather than
passing in a separate x,y pair, and rename it normalized_get_direction to
match. Since it now depends on the normalized_coords type which gets declared
in libinput-private.h also move it to libinput-private.h .
Note this commit also contains a functional change wrt the get_direction
usuage in the palm detection. The palm-detection code was calling get_direction
on non normalized coordinates, this commits changes the code to normalize
the coordinates first. This is the right thing to do as calling get_direction
on non normalized coordinates may result in a wrong direction getting returned
when the x and y resolution of the touchpad are not identical.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/filter.c')
-rw-r--r-- | src/filter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/filter.c b/src/filter.c index dd4bd58d..033201fc 100644 --- a/src/filter.c +++ b/src/filter.c @@ -122,7 +122,7 @@ feed_trackers(struct pointer_accelerator *accel, trackers[current].delta.x = 0.0; trackers[current].delta.y = 0.0; trackers[current].time = time; - trackers[current].dir = vector_get_direction(delta->x, delta->y); + trackers[current].dir = normalized_get_direction(*delta); } static struct pointer_tracker * |