Merge pull request #5081 from DustinLuck/master

Fix horizontal mouse wheel scroll direction
This commit is contained in:
Rainer Kottenhoff 2024-01-10 20:58:09 +01:00 committed by GitHub
commit 5bac2c544e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1650,7 +1650,8 @@ sptr_t ScintillaWin::MouseMessage(unsigned int iMessage, uptr_t wParam, sptr_t l
MouseWheelDelta &wheelDelta = (iMessage == WM_MOUSEHWHEEL) ? horizontalWheelDelta : verticalWheelDelta;
if (wheelDelta.Accumulate(wParam)) {
const int charsToScroll = charsPerScroll * wheelDelta.Actions();
const int scrollDirectionAdjustment = (iMessage == WM_MOUSEHWHEEL) ? -1 : 1;
const int charsToScroll = charsPerScroll * wheelDelta.Actions() * scrollDirectionAdjustment;
const int widthToScroll = static_cast<int>(std::lround(charsToScroll * vs.aveCharWidth));
HorizontalScrollToClamped(xOffset + widthToScroll);
}