From 61493102620438f6f6640b89f02c088d9f87e268 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 28 Nov 2020 20:44:28 +0200 Subject: Windows: Horizontal mouse wheel direction The same mouse behaves differently on different operating systems. --- src/ui/documentwidget.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/ui/documentwidget.c') 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 smoothDuration_DocumentWidget_ * /* accelerated speed for repeated wheelings */ (!isFinished_Anim(&d->scrollY) && pos_Anim(&d->scrollY) < 0.25f ? 0.5f : 1.0f)); +#if defined (iPlatformMsys) + const int horizStep = ev->wheel.x * 3; +#else + const int horizStep = ev->wheel.x * -3; +#endif scrollWideBlock_DocumentWidget_( - d, mouseCoord, -ev->wheel.x * lineHeight_Text(paragraph_FontId) * 3, 167); + d, mouseCoord, horizStep * lineHeight_Text(paragraph_FontId), 167); } iChangeFlags(d->flags, noHoverWhileScrolling_DocumentWidgetFlag, iTrue); return iTrue; @@ -2343,7 +2348,7 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e further to do. */ return iTrue; } - if (!requestMedia_DocumentWidget_(d, linkId)) { + if (!requestMedia_DocumentWidget_(d, linkId)) { if (linkFlags & content_GmLinkFlag) { /* Dismiss shown content on click. */ setData_Media(media_GmDocument(d->doc), -- cgit v1.2.3