diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-28 20:44:28 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-28 20:44:28 +0200 |
commit | 61493102620438f6f6640b89f02c088d9f87e268 (patch) | |
tree | 541c674a750c0e68a11cd6df5dc85fce550a87af /src/ui/documentwidget.c | |
parent | deac62d1e2cd20348b87397ce2f9af0ab67d32a3 (diff) |
Windows: Horizontal mouse wheel direction
The same mouse behaves differently on different operating systems.
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r-- | src/ui/documentwidget.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index cd2dd14a..0a7be185 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -2150,8 +2150,13 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e | |||
2150 | smoothDuration_DocumentWidget_ * | 2150 | smoothDuration_DocumentWidget_ * |
2151 | /* accelerated speed for repeated wheelings */ | 2151 | /* accelerated speed for repeated wheelings */ |
2152 | (!isFinished_Anim(&d->scrollY) && pos_Anim(&d->scrollY) < 0.25f ? 0.5f : 1.0f)); | 2152 | (!isFinished_Anim(&d->scrollY) && pos_Anim(&d->scrollY) < 0.25f ? 0.5f : 1.0f)); |
2153 | #if defined (iPlatformMsys) | ||
2154 | const int horizStep = ev->wheel.x * 3; | ||
2155 | #else | ||
2156 | const int horizStep = ev->wheel.x * -3; | ||
2157 | #endif | ||
2153 | scrollWideBlock_DocumentWidget_( | 2158 | scrollWideBlock_DocumentWidget_( |
2154 | d, mouseCoord, -ev->wheel.x * lineHeight_Text(paragraph_FontId) * 3, 167); | 2159 | d, mouseCoord, horizStep * lineHeight_Text(paragraph_FontId), 167); |
2155 | } | 2160 | } |
2156 | iChangeFlags(d->flags, noHoverWhileScrolling_DocumentWidgetFlag, iTrue); | 2161 | iChangeFlags(d->flags, noHoverWhileScrolling_DocumentWidgetFlag, iTrue); |
2157 | return iTrue; | 2162 | return iTrue; |
@@ -2343,7 +2348,7 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e | |||
2343 | further to do. */ | 2348 | further to do. */ |
2344 | return iTrue; | 2349 | return iTrue; |
2345 | } | 2350 | } |
2346 | if (!requestMedia_DocumentWidget_(d, linkId)) { | 2351 | if (!requestMedia_DocumentWidget_(d, linkId)) { |
2347 | if (linkFlags & content_GmLinkFlag) { | 2352 | if (linkFlags & content_GmLinkFlag) { |
2348 | /* Dismiss shown content on click. */ | 2353 | /* Dismiss shown content on click. */ |
2349 | setData_Media(media_GmDocument(d->doc), | 2354 | setData_Media(media_GmDocument(d->doc), |