Author: jimtabor Date: Fri Feb 6 21:17:10 2015 New Revision: 66184
URL: http://svn.reactos.org/svn/reactos?rev=66184&view=rev Log: [User32] - Patch by Huw Davies : Merge the blitting of the centered and non-centered cases.
Modified: trunk/reactos/win32ss/user/user32/controls/static.c
Modified: trunk/reactos/win32ss/user/user32/controls/static.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/control... ============================================================================== --- trunk/reactos/win32ss/user/user32/controls/static.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/controls/static.c [iso-8859-1] Fri Feb 6 21:17:10 2015 @@ -823,19 +823,14 @@ GetClientRect(hwnd, &rcClient); if (style & SS_CENTERIMAGE) { - INT x, y; - x = (rcClient.right - rcClient.left)/2 - bm.bmWidth/2; - y = (rcClient.bottom - rcClient.top)/2 - bm.bmHeight/2; - FillRect( hdc, &rcClient, hbrush ); - BitBlt(hdc, x, y, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, - SRCCOPY); - } - else - { - StretchBlt(hdc, 0, 0, rcClient.right - rcClient.left, - rcClient.bottom - rcClient.top, hMemDC, - 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY); - } + rcClient.left = (rcClient.right - rcClient.left)/2 - bm.bmWidth/2; + rcClient.top = (rcClient.bottom - rcClient.top)/2 - bm.bmHeight/2; + rcClient.right = rcClient.left + bm.bmWidth; + rcClient.bottom = rcClient.top + bm.bmHeight; + } + StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left, + rcClient.bottom - rcClient.top, hMemDC, + 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY); SelectObject(hMemDC, oldbitmap); DeleteDC(hMemDC); }