comctl32/button: Avoid push button content covering frames.

A focus frame may be covered by content in the push button.
Shrink the label rectangle before layout calculation so that
content can never cover the frame.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2018-09-05 22:58:05 +08:00 committed by Alexandre Julliard
parent 1f323f31d6
commit 790d13ee98
1 changed files with 2 additions and 0 deletions

View File

@ -1250,6 +1250,8 @@ static void PB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action )
/* draw button label */
labelRect = rc;
/* Shrink label rect at all sides by 2 so that the content won't touch the surrounding frame */
InflateRect(&labelRect, -2, -2);
dtFlags = BUTTON_CalcLayoutRects(infoPtr, hDC, &labelRect, &imageRect, &textRect);
if (dtFlags == (UINT)-1L)