diff options
-rw-r--r-- | src/ui/documentwidget.c | 10 |
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 | } |