From 4f28f7967d2a3a236028858b26dae0715c6a0c9a Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 6 Sep 2006 23:00:45 +0900 Subject: [PATCH] user: Use computed icon rectangle if SS_CENTERIMAGE style is set. --- dlls/user/static.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/user/static.c b/dlls/user/static.c index 4eef677da3b..ecfb8e4323a 100644 --- a/dlls/user/static.c +++ b/dlls/user/static.c @@ -760,9 +760,11 @@ static void STATIC_PaintIconfn( HWND hwnd, HDC hdc, DWORD style ) iconRect.right = iconRect.left + info->nWidth; iconRect.bottom = iconRect.top + info->nHeight; } + else + iconRect = rc; FillRect( hdc, &rc, hbrush ); - DrawIconEx( hdc, rc.left, rc.top, hIcon, rc.right - rc.left, - rc.bottom - rc.top, 0, NULL, DI_NORMAL ); + DrawIconEx( hdc, iconRect.left, iconRect.top, hIcon, iconRect.right - iconRect.left, + iconRect.bottom - iconRect.top, 0, NULL, DI_NORMAL ); } if (info) GlobalUnlock16(HICON_16(hIcon)); }