[PATCH 1/4] uxtheme: Remove useless calculation.
Zhiyi Zhang
zzhang at codeweavers.com
Tue Aug 24 01:35:07 CDT 2021
rcDst is not used after it is used for getting destination rectangle width and height.
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
dlls/uxtheme/draw.c | 29 +++--------------------------
1 file changed, 3 insertions(+), 26 deletions(-)
diff --git a/dlls/uxtheme/draw.c b/dlls/uxtheme/draw.c
index b8196b09966..424e08c4183 100644
--- a/dlls/uxtheme/draw.c
+++ b/dlls/uxtheme/draw.c
@@ -568,16 +568,13 @@ static HRESULT get_image_part_size (HTHEME hTheme, HDC hdc, int iPartId,
case TS_DRAW:
if (prc != NULL)
{
- RECT rcDst;
POINT dstSize;
POINT srcSize;
int sizingtype = ST_STRETCH;
BOOL uniformsizing = FALSE;
- rcDst = *prc;
-
- dstSize.x = rcDst.right-rcDst.left;
- dstSize.y = rcDst.bottom-rcDst.top;
+ dstSize.x = prc->right - prc->left;
+ dstSize.y = prc->bottom - prc->top;
srcSize.x = rcSrc.right-rcSrc.left;
srcSize.y = rcSrc.bottom-rcSrc.top;
@@ -585,35 +582,15 @@ static HRESULT get_image_part_size (HTHEME hTheme, HDC hdc, int iPartId,
if(uniformsizing) {
/* Scale height and width equally */
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
- {
dstSize.x = MulDiv (srcSize.x, dstSize.y, srcSize.y);
- rcDst.right = rcDst.left + dstSize.x;
- }
}
GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_SIZINGTYPE, &sizingtype);
if(sizingtype == ST_TRUESIZE) {
int truesizestretchmark = 100;
-
- if(dstSize.x < 0 || dstSize.y < 0) {
- BOOL mirrorimage = TRUE;
- GetThemeBool(hTheme, iPartId, iStateId, TMT_MIRRORIMAGE, &mirrorimage);
- if(mirrorimage) {
- if(dstSize.x < 0) {
- rcDst.left += dstSize.x;
- rcDst.right += dstSize.x;
- }
- if(dstSize.y < 0) {
- rcDst.top += dstSize.y;
- rcDst.bottom += dstSize.y;
- }
- }
- }
+
/* Whatever TrueSizeStretchMark does - it does not seem to
* be what's outlined below. It appears as if native
* uxtheme always stretches if dest is smaller than source
--
2.30.2
More information about the wine-devel
mailing list