Better computations to have uniformly sized parts scaled in both

directions.
This commit is contained in:
Frank Richter 2005-08-15 09:34:21 +00:00 committed by Alexandre Julliard
parent 65f10442a7
commit 8ff3c7e623
1 changed files with 6 additions and 6 deletions

View File

@ -448,14 +448,14 @@ static HRESULT get_image_part_size (HTHEME hTheme, HDC hdc, int iPartId,
GetThemeBool(hTheme, iPartId, iStateId, TMT_UNIFORMSIZING, &uniformsizing);
if(uniformsizing) {
/* Scale height and width equally */
int widthDiff = abs(srcSize.x-dstSize.x);
int heightDiff = abs(srcSize.y-dstSize.x);
if(widthDiff > heightDiff) {
dstSize.y -= widthDiff-heightDiff;
if (dstSize.x*srcSize.y < dstSize.y*srcSize.x)
{
dstSize.y = MulDiv (srcSize.y, dstSize.x, srcSize.x);
rcDst.bottom = rcDst.top + dstSize.y;
}
else if(heightDiff > widthDiff) {
dstSize.x -= heightDiff-widthDiff;
else
{
dstSize.x = MulDiv (srcSize.x, dstSize.y, srcSize.y);
rcDst.right = rcDst.left + dstSize.x;
}
}