Add support for horizontal & vertical alignment when doing truesize

sizing.
This commit is contained in:
Frank Richter 2005-08-03 14:54:28 +00:00 committed by Alexandre Julliard
parent 84fb7913f9
commit 46c31adab2
1 changed files with 13 additions and 2 deletions

View File

@ -556,9 +556,20 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId,
GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_SIZINGTYPE, &sizingtype);
if(sizingtype == ST_TRUESIZE) {
int valign = VA_CENTER, halign = HA_CENTER;
get_image_part_size (hTheme, hdc, iPartId, iStateId, pRect, TS_DRAW, &drawSize);
GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_VALIGN, &valign);
GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_HALIGN, &halign);
if (halign == HA_CENTER)
rcDst.left += (dstSize.x/2)-(drawSize.x/2);
else if (halign == HA_RIGHT)
rcDst.left = rcDst.right - drawSize.x;
if (valign == VA_CENTER)
rcDst.top += (dstSize.y/2)-(drawSize.y/2);
else if (valign == VA_BOTTOM)
rcDst.top = rcDst.bottom - drawSize.y;
rcDst.right = rcDst.left + drawSize.x;
rcDst.bottom = rcDst.top + drawSize.y;
if(!UXTHEME_StretchBlt(hdc, rcDst.left, rcDst.top, drawSize.x, drawSize.y,