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>
This commit is contained in:
Peter Hutterer 2016-11-21 11:03:58 +10:00
parent ea8545bd2f
commit 63409a6938

View file

@ -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);