uxtheme: Remove a redundant condition check.

The sizingtype check is redundant because it can only be ST_TRUESIZE, ST_STRETCH or ST_TILE and the
check is already in the not ST_TRUESIZE branch.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2022-03-24 17:06:14 +08:00 committed by Alexandre Julliard
parent d987c277c1
commit f9923d6bb9
1 changed files with 54 additions and 55 deletions

View File

@ -710,6 +710,7 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, RECT *pRect, int iStateId, RECT *pRect,
const DTBGOPTS *pOptions) const DTBGOPTS *pOptions)
{ {
int destCenterWidth, srcCenterWidth, destCenterHeight, srcCenterHeight;
HRESULT hr = S_OK; HRESULT hr = S_OK;
HBITMAP bmpSrc; HBITMAP bmpSrc;
HGDIOBJ oldSrc; HGDIOBJ oldSrc;
@ -825,11 +826,10 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId,
goto draw_error; goto draw_error;
} }
if ((sizingtype == ST_STRETCH) || (sizingtype == ST_TILE)) { destCenterWidth = dstSize.x - (sm.cxLeftWidth + sm.cxRightWidth);
int destCenterWidth = dstSize.x - (sm.cxLeftWidth + sm.cxRightWidth); srcCenterWidth = srcSize.x - (sm.cxLeftWidth + sm.cxRightWidth);
int srcCenterWidth = srcSize.x - (sm.cxLeftWidth + sm.cxRightWidth); destCenterHeight = dstSize.y - (sm.cyTopHeight + sm.cyBottomHeight);
int destCenterHeight = dstSize.y - (sm.cyTopHeight + sm.cyBottomHeight); srcCenterHeight = srcSize.y - (sm.cyTopHeight + sm.cyBottomHeight);
int srcCenterHeight = srcSize.y - (sm.cyTopHeight + sm.cyBottomHeight);
if(destCenterWidth > 0) { if(destCenterWidth > 0) {
/* Center top */ /* Center top */
@ -887,7 +887,6 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId,
} }
} }
} }
}
draw_error: draw_error:
SetViewportOrgEx (hdcDst, org.x, org.y, NULL); SetViewportOrgEx (hdcDst, org.x, org.y, NULL);