Fix horizontal mouse wheel scrolling direction

This commit is contained in:
Dustin Luck 2024-01-09 21:57:59 +00:00
parent d59f6a0119
commit 2fcbdcd29d

View File

@ -1647,7 +1647,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);
}