Commit 46c31ada authored by Frank Richter's avatar Frank Richter Committed by Alexandre Julliard

Add support for horizontal & vertical alignment when doing truesize

sizing.
parent 84fb7913
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment