[PATCH libinput 6/7] filter: Fix get_direction for short vectors

Jonas Ådahl jadahl at gmail.com
Mon May 26 14:27:29 PDT 2014


Short vectors alongside the x axis produced inverted directions.

Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
---
 src/filter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/filter.c b/src/filter.c
index 45f060f..df4d60a 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -105,9 +105,9 @@ get_direction(int dx, int dy)
 		else if (dx < 0 && dy < 0)
 			dir = N | NW | W;
 		else if (dx > 0)
-			dir = NW | W | SW;
-		else if (dx < 0)
 			dir = NE | E | SE;
+		else if (dx < 0)
+			dir = NW | W | SW;
 		else if (dy > 0)
 			dir = SE | S | SW;
 		else if (dy < 0)
-- 
1.9.1



More information about the wayland-devel mailing list