summaryrefslogtreecommitdiff
path: root/src/ui/documentwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-02-19 10:36:37 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-02-19 10:36:37 +0200
commit4cb785e2b175424316a5795b1e5dcf012a69b134 (patch)
tree78b7e84267b32cd9385609497fcadabc0adb7bf1 /src/ui/documentwidget.c
parent3d0f88fcf9a262680c19bd5c44e407a02c409dcf (diff)
Touch: Scroll momentum tuning; edge swipes
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r--src/ui/documentwidget.c7
1 files changed, 4 insertions, 3 deletions
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
2352 if (ev->wheel.which == 0) { /* Trackpad with precise scrolling w/inertia. */ 2352 if (ev->wheel.which == 0) { /* Trackpad with precise scrolling w/inertia. */
2353 stop_Anim(&d->scrollY); 2353 stop_Anim(&d->scrollY);
2354 iInt2 wheel = mulf_I2(init_I2(ev->wheel.x, ev->wheel.y), get_Window()->pixelRatio); 2354 iInt2 wheel = mulf_I2(init_I2(ev->wheel.x, ev->wheel.y), get_Window()->pixelRatio);
2355#if defined (iPlatformAppleMobile)
2356 wheel.x = -wheel.x;
2357#else
2355 /* Only scroll on one axis at a time. */ 2358 /* Only scroll on one axis at a time. */
2356 if (iAbs(wheel.x) > iAbs(wheel.y)) { 2359 if (iAbs(wheel.x) > iAbs(wheel.y)) {
2357 wheel.y = 0; 2360 wheel.y = 0;
@@ -2359,10 +2362,8 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
2359 else { 2362 else {
2360 wheel.x = 0; 2363 wheel.x = 0;
2361 } 2364 }
2362 scroll_DocumentWidget_(d, -wheel.y);
2363#if defined (iPlatformAppleMobile)
2364 wheel.x = -wheel.x;
2365#endif 2365#endif
2366 scroll_DocumentWidget_(d, -wheel.y);
2366 scrollWideBlock_DocumentWidget_(d, mouseCoord, wheel.x, 0); 2367 scrollWideBlock_DocumentWidget_(d, mouseCoord, wheel.x, 0);
2367 } 2368 }
2368 else 2369 else