mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-14 18:25:40 +00:00
Make sure winhelp doesn't scroll outside of its display area.
This commit is contained in:
parent
49b408b192
commit
84d5992357
|
@ -814,6 +814,8 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam,
|
||||||
RECT rect;
|
RECT rect;
|
||||||
INT Min, Max;
|
INT Min, Max;
|
||||||
INT CurPos = GetScrollPos(hWnd, SB_VERT);
|
INT CurPos = GetScrollPos(hWnd, SB_VERT);
|
||||||
|
INT dy;
|
||||||
|
|
||||||
GetScrollRange(hWnd, SB_VERT, &Min, &Max);
|
GetScrollRange(hWnd, SB_VERT, &Min, &Max);
|
||||||
GetClientRect(hWnd, &rect);
|
GetClientRect(hWnd, &rect);
|
||||||
|
|
||||||
|
@ -831,7 +833,11 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam,
|
||||||
}
|
}
|
||||||
if (update)
|
if (update)
|
||||||
{
|
{
|
||||||
INT dy = GetScrollPos(hWnd, SB_VERT) - CurPos;
|
if (CurPos > Max)
|
||||||
|
CurPos = Max;
|
||||||
|
else if (CurPos < Min)
|
||||||
|
CurPos = Min;
|
||||||
|
dy = GetScrollPos(hWnd, SB_VERT) - CurPos;
|
||||||
SetScrollPos(hWnd, SB_VERT, CurPos, TRUE);
|
SetScrollPos(hWnd, SB_VERT, CurPos, TRUE);
|
||||||
ScrollWindow(hWnd, 0, dy, NULL, NULL);
|
ScrollWindow(hWnd, 0, dy, NULL, NULL);
|
||||||
UpdateWindow(hWnd);
|
UpdateWindow(hWnd);
|
||||||
|
|
Loading…
Reference in a new issue