summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-12-17 10:26:26 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-12-17 10:26:26 +0200
commit1c38deb8409ef9e3f1f4a089ef0e87dcb84bc81e (patch)
treed2d92ca42c1aa53cefab14ef57bde20074620853
parent8298f3fc47d2c859ffd1cd72f6b4b0c480565bcf (diff)
macOS: Fixed scrolling of wide preformatted blocks
-rw-r--r--src/ui/documentwidget.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index d0a9a55d..4ab17b42 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -3917,8 +3917,8 @@ static iBool handleWheelSwipe_DocumentWidget_(iDocumentWidget *d, const SDL_Mous
3917 case none_WheelSwipeState: 3917 case none_WheelSwipeState:
3918 /* A new swipe starts. */ 3918 /* A new swipe starts. */
3919 if (!isInertia_MouseWheelEvent(ev) && !isScrollFinished_MouseWheelEvent(ev)) { 3919 if (!isInertia_MouseWheelEvent(ev) && !isScrollFinished_MouseWheelEvent(ev)) {
3920 int side = ev->x < 0 ? 1 : 2; 3920 int side = ev->x > 0 ? 1 : 2;
3921 d->wheelSwipeDistance = -ev->x; 3921 d->wheelSwipeDistance = ev->x * 2;
3922 d->flags &= ~eitherWheelSwipe_DocumentWidgetFlag; 3922 d->flags &= ~eitherWheelSwipe_DocumentWidgetFlag;
3923 d->flags |= (side == 1 ? leftWheelSwipe_DocumentWidgetFlag 3923 d->flags |= (side == 1 ? leftWheelSwipe_DocumentWidgetFlag
3924 : rightWheelSwipe_DocumentWidgetFlag); 3924 : rightWheelSwipe_DocumentWidgetFlag);
@@ -3935,7 +3935,7 @@ static iBool handleWheelSwipe_DocumentWidget_(iDocumentWidget *d, const SDL_Mous
3935 d->wheelSwipeState = none_WheelSwipeState; 3935 d->wheelSwipeState = none_WheelSwipeState;
3936 } 3936 }
3937 else { 3937 else {
3938 int step = -ev->x * 2; 3938 int step = ev->x * 2;
3939 d->wheelSwipeDistance += step; 3939 d->wheelSwipeDistance += step;
3940 /* Remember the maximum speed. */ 3940 /* Remember the maximum speed. */
3941 if (d->swipeSpeed < 0 && step < 0) { 3941 if (d->swipeSpeed < 0 && step < 0) {
@@ -4064,7 +4064,9 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
4064#endif 4064#endif
4065 } 4065 }
4066 } 4066 }
4067 else if (ev->type == SDL_MOUSEWHEEL && ev->wheel.y == 0 && 4067 else if (ev->type == SDL_MOUSEWHEEL &&
4068 ev->wheel.y == 0 &&
4069 d->wheelSwipeState == direct_WheelSwipeState &&
4068 handleWheelSwipe_DocumentWidget_(d, &ev->wheel)) { 4070 handleWheelSwipe_DocumentWidget_(d, &ev->wheel)) {
4069 return iTrue; 4071 return iTrue;
4070 } 4072 }