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:
parent
5a5287bc8b
commit
84aecbca81
11 changed files with 20 additions and 15 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue