From e880479ff29e57d8b47f08f620b4bccdd2683aa5 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Sat, 30 Jan 2010 16:34:51 +0100 Subject: sweep feels better without memory --- src/multitouch.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/multitouch.c b/src/multitouch.c index ff22760..e04cdaa 100644 --- a/src/multitouch.c +++ b/src/multitouch.c @@ -257,13 +257,14 @@ static void handle_gestures(LocalDevicePtr local, } if (GETBIT(gs->type, GS_HSCROLL)) { hscroll += gs->dx; - while (hscroll > hstep) { + // sweep is more natural as a one-time thing + if (hscroll > hstep) { tickle_button(local, 6); - hscroll -= hstep; - } - while (hscroll < -hstep) { + hscroll = 0; + } + if (hscroll < -hstep) { tickle_button(local, 7); - hscroll += hstep; + hscroll = 0; } TRACE1("hscroll: %d\n", gs->dx); } -- cgit v1.2.3