Made paintContainerBackground() in windows/container.c respect the clip rect.
This commit is contained in:
parent
74fc1aea45
commit
047913d1a6
|
@ -67,7 +67,7 @@ static void endParentDraw(struct parentDraw *pd)
|
||||||
static HBRUSH getControlBackgroundBrush(HWND hwnd, HDC dc)
|
static HBRUSH getControlBackgroundBrush(HWND hwnd, HDC dc)
|
||||||
{
|
{
|
||||||
HWND parent;
|
HWND parent;
|
||||||
RECT parentRect, hwndScreenRect;
|
RECT hwndScreenRect;
|
||||||
struct parentDraw pd;
|
struct parentDraw pd;
|
||||||
HBRUSH brush;
|
HBRUSH brush;
|
||||||
|
|
||||||
|
@ -90,22 +90,23 @@ static HBRUSH getControlBackgroundBrush(HWND hwnd, HDC dc)
|
||||||
return brush;
|
return brush;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO this needs to respect clipping
|
|
||||||
static void paintContainerBackground(HWND hwnd, HDC dc, RECT *paintRect)
|
static void paintContainerBackground(HWND hwnd, HDC dc, RECT *paintRect)
|
||||||
{
|
{
|
||||||
HWND parent;
|
HWND parent;
|
||||||
RECT r;
|
RECT paintRectParent;
|
||||||
POINT prevOrigin;
|
struct parentDraw pd;
|
||||||
|
|
||||||
parent = realParent(hwnd);
|
parent = realParent(hwnd);
|
||||||
|
parentDraw(dc, parent, &pd);
|
||||||
|
|
||||||
if (GetWindowRect(hwnd, &r) == 0)
|
paintRectParent = *paintRect;
|
||||||
logLastError("error getting window rect in paintContainerBackground()");
|
mapWindowRect(hwnd, parent, &paintRectParent);
|
||||||
mapWindowRect(NULL, parent, &r);
|
if (BitBlt(dc, paintRect->left, paintRect->top, paintRect->right - paintRect->left, paintRect->bottom - paintRect->top,
|
||||||
// TODO check errors
|
pd.cdc, paintRectParent.left, paintRectParent.top,
|
||||||
SetWindowOrgEx(dc, r.left, r.top, &prevOrigin);
|
SRCCOPY) == 0)
|
||||||
SendMessageW(parent, WM_PRINTCLIENT, (WPARAM) dc, PRF_CLIENT);
|
logLastError("error drawing parent background over uiContainer in paintContainerBackground()");
|
||||||
SetWindowOrgEx(dc, prevOrigin.x, prevOrigin.y, NULL);
|
|
||||||
|
endParentDraw(&pd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// from https://msdn.microsoft.com/en-us/library/windows/desktop/dn742486.aspx#sizingandspacing and https://msdn.microsoft.com/en-us/library/windows/desktop/bb226818%28v=vs.85%29.aspx
|
// from https://msdn.microsoft.com/en-us/library/windows/desktop/dn742486.aspx#sizingandspacing and https://msdn.microsoft.com/en-us/library/windows/desktop/bb226818%28v=vs.85%29.aspx
|
||||||
|
|
Loading…
Reference in New Issue