fix a bug of GetUpdateRect: intersect bouding rectangle of invalid region with client rect

This commit is contained in:
Vincent Wei
2023-09-16 15:43:07 +08:00
parent 7513d461bf
commit e118805eef

View File

@@ -5585,11 +5585,13 @@ BOOL GUIAPI ValidateRegion (HWND hWnd, const CLIPRGN* pRgn)
BOOL GUIAPI GetUpdateRect (HWND hWnd, RECT* update_rect)
{
PMAINWIN pWin;
RECT rcClient;
MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), FALSE);
pWin = MG_GET_WINDOW_PTR (hWnd);
*update_rect = pWin->InvRgn.rgn.rcBound;
GetClientRect(hWnd, &rcClient);
IntersectRect(update_rect, &pWin->InvRgn.rgn.rcBound, &rcClient);
return TRUE;
}