1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Smoother mouse wheel scrolling

This commit is contained in:
Brian Fiete 2020-05-25 00:10:35 -07:00
parent 5a5287bc8b
commit 84aecbca81
11 changed files with 20 additions and 15 deletions

View file

@ -634,11 +634,16 @@ LRESULT WinBFWindow::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
aWindow->mIsMouseInside = true;
cursorWindow = aWindow;
}
}
}
++itr;
}
}
UINT ucNumLines = 0;
SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &ucNumLines, 0);
if (ucNumLines == 0)
ucNumLines = 3; // Default
if ((cursorWindow != this) && (mIsMouseInside))
{
mMouseLeaveFunc(this);
@ -648,7 +653,7 @@ LRESULT WinBFWindow::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
POINT pt = {x, y};
ScreenToClient(cursorWindow->mHWnd, &pt);
int delta = ((int16)HIWORD(wParam)) / 120;
float delta = ((int16)HIWORD(wParam)) / 120.0f * (float)ucNumLines;
mMouseWheelFunc(cursorWindow, pt.x, pt.y, delta);
}
break;