From 4cb785e2b175424316a5795b1e5dcf012a69b134 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 19 Feb 2021 10:36:37 +0200 Subject: Touch: Scroll momentum tuning; edge swipes --- src/ui/documentwidget.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/ui/documentwidget.c') diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 0a282f1b..9619c56e 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -2352,6 +2352,9 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e if (ev->wheel.which == 0) { /* Trackpad with precise scrolling w/inertia. */ stop_Anim(&d->scrollY); iInt2 wheel = mulf_I2(init_I2(ev->wheel.x, ev->wheel.y), get_Window()->pixelRatio); +#if defined (iPlatformAppleMobile) + wheel.x = -wheel.x; +#else /* Only scroll on one axis at a time. */ if (iAbs(wheel.x) > iAbs(wheel.y)) { wheel.y = 0; @@ -2359,10 +2362,8 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e else { wheel.x = 0; } - scroll_DocumentWidget_(d, -wheel.y); -#if defined (iPlatformAppleMobile) - wheel.x = -wheel.x; #endif + scroll_DocumentWidget_(d, -wheel.y); scrollWideBlock_DocumentWidget_(d, mouseCoord, wheel.x, 0); } else -- cgit v1.2.3