diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2016-11-21 11:03:58 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2016-11-22 11:23:39 +1000 |
commit | 63409a693865f11262a15d941755f1277357289e (patch) | |
tree | f85c5d7b43abd2864b36e4183bf1a08ba97be443 | |
parent | ea8545bd2f05fe9c558e597d98fc94609aa5087a (diff) |
test: start with the first offset when moving touches
This doesn't have an effect in our current tests because the touchpad always
needs 4 motion events to get moving. But for the future, it simplifies the
case of "i want to move between x1/y1 and x2/y2", because it fills in only the
events in between rather than re-using the touch down coordinates and thus not
causing a motion on the first event.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r-- | test/litest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/litest.c b/test/litest.c index 94da85ae..e685d61a 100644 --- a/test/litest.c +++ b/test/litest.c @@ -1603,7 +1603,7 @@ litest_touch_move_to(struct litest_device *d, double x_to, double y_to, int steps, int sleep_ms) { - for (int i = 0; i < steps - 1; i++) { + for (int i = 1; i < steps - 1; i++) { litest_touch_move(d, slot, x_from + (x_to - x_from)/steps * i, y_from + (y_to - y_from)/steps * i); @@ -1699,7 +1699,7 @@ litest_touch_move_two_touches(struct litest_device *d, double dx, double dy, int steps, int sleep_ms) { - for (int i = 0; i < steps - 1; i++) { + for (int i = 1; i < steps; i++) { litest_push_event_frame(d); litest_touch_move(d, 0, x0 + dx / steps * i, y0 + dy / steps * i); |