user32: Make sure to setup clipping before any painting is done.
This commit is contained in:
parent
c316c1a29f
commit
9e3ab87a9c
|
@ -903,6 +903,7 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
|
||||||
if (!hBrush) /* did the app forget to call defwindowproc ? */
|
if (!hBrush) /* did the app forget to call defwindowproc ? */
|
||||||
hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC,
|
hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC,
|
||||||
(WPARAM)hDC, (LPARAM)hwnd );
|
(WPARAM)hDC, (LPARAM)hwnd );
|
||||||
|
setup_clipping( hwnd, hDC );
|
||||||
|
|
||||||
if (style & BS_LEFTTEXT)
|
if (style & BS_LEFTTEXT)
|
||||||
{
|
{
|
||||||
|
@ -916,7 +917,7 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
|
||||||
rtext.left += checkBoxWidth + 4;
|
rtext.left += checkBoxWidth + 4;
|
||||||
rbox.right = checkBoxWidth;
|
rbox.right = checkBoxWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Since WM_ERASEBKGND does nothing, first prepare background */
|
/* Since WM_ERASEBKGND does nothing, first prepare background */
|
||||||
if (action == ODA_SELECT) FillRect( hDC, &rbox, hBrush );
|
if (action == ODA_SELECT) FillRect( hDC, &rbox, hBrush );
|
||||||
if (action == ODA_DRAWENTIRE) FillRect( hDC, &client, hBrush );
|
if (action == ODA_DRAWENTIRE) FillRect( hDC, &client, hBrush );
|
||||||
|
@ -982,8 +983,6 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
|
||||||
if (dtFlags == (UINT)-1L) /* Noting to draw */
|
if (dtFlags == (UINT)-1L) /* Noting to draw */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
setup_clipping( hwnd, hDC );
|
|
||||||
|
|
||||||
if (action == ODA_DRAWENTIRE)
|
if (action == ODA_DRAWENTIRE)
|
||||||
BUTTON_DrawLabel(hwnd, hDC, dtFlags, &rtext);
|
BUTTON_DrawLabel(hwnd, hDC, dtFlags, &rtext);
|
||||||
|
|
||||||
|
@ -1044,6 +1043,7 @@ static void GB_Paint( HWND hwnd, HDC hDC, UINT action )
|
||||||
if (!hbr) /* did the app forget to call defwindowproc ? */
|
if (!hbr) /* did the app forget to call defwindowproc ? */
|
||||||
hbr = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC,
|
hbr = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC,
|
||||||
(WPARAM)hDC, (LPARAM)hwnd);
|
(WPARAM)hDC, (LPARAM)hwnd);
|
||||||
|
setup_clipping( hwnd, hDC );
|
||||||
|
|
||||||
GetClientRect( hwnd, &rc);
|
GetClientRect( hwnd, &rc);
|
||||||
rcFrame = rc;
|
rcFrame = rc;
|
||||||
|
@ -1058,8 +1058,6 @@ static void GB_Paint( HWND hwnd, HDC hDC, UINT action )
|
||||||
if (dtFlags == (UINT)-1L)
|
if (dtFlags == (UINT)-1L)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
setup_clipping( hwnd, hDC );
|
|
||||||
|
|
||||||
/* Because buttons have CS_PARENTDC class style, there is a chance
|
/* Because buttons have CS_PARENTDC class style, there is a chance
|
||||||
* that label will be drawn out of client rect.
|
* that label will be drawn out of client rect.
|
||||||
* But Windows doesn't clip label's rect, so do I.
|
* But Windows doesn't clip label's rect, so do I.
|
||||||
|
|
Loading…
Reference in New Issue