Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9a03000e
Commit
9a03000e
authored
Aug 29, 2005
by
Frank Richter
Committed by
Alexandre Julliard
Aug 29, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Take a common computation out of two if-branches in
UXTHEME_LoadImage().
parent
f1a2ee52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
draw.c
dlls/uxtheme/draw.c
+4
-2
No files found.
dlls/uxtheme/draw.c
View file @
9a03000e
...
...
@@ -210,6 +210,7 @@ static HRESULT UXTHEME_LoadImage(HTHEME hTheme, HDC hdc, int iPartId, int iState
{
int
imagelayout
=
IL_HORIZONTAL
;
int
imagecount
=
1
;
int
imagenum
;
BITMAP
bmp
;
WCHAR
szPath
[
MAX_PATH
];
BOOL
hasAlpha
;
...
...
@@ -228,17 +229,18 @@ static HRESULT UXTHEME_LoadImage(HTHEME hTheme, HDC hdc, int iPartId, int iState
GetThemeEnumValue
(
hTheme
,
iPartId
,
iStateId
,
TMT_IMAGELAYOUT
,
&
imagelayout
);
GetThemeInt
(
hTheme
,
iPartId
,
iStateId
,
TMT_IMAGECOUNT
,
&
imagecount
);
imagenum
=
max
(
min
(
imagecount
,
iStateId
),
1
)
-
1
;
GetObjectW
(
*
hBmp
,
sizeof
(
bmp
),
&
bmp
);
if
(
imagelayout
==
IL_VERTICAL
)
{
int
height
=
bmp
.
bmHeight
/
imagecount
;
bmpRect
->
left
=
0
;
bmpRect
->
right
=
bmp
.
bmWidth
;
bmpRect
->
top
=
(
max
(
min
(
imagecount
,
iStateId
),
1
)
-
1
)
*
height
;
bmpRect
->
top
=
imagenum
*
height
;
bmpRect
->
bottom
=
bmpRect
->
top
+
height
;
}
else
{
int
width
=
bmp
.
bmWidth
/
imagecount
;
bmpRect
->
left
=
(
max
(
min
(
imagecount
,
iStateId
),
1
)
-
1
)
*
width
;
bmpRect
->
left
=
imagenum
*
width
;
bmpRect
->
right
=
bmpRect
->
left
+
width
;
bmpRect
->
top
=
0
;
bmpRect
->
bottom
=
bmp
.
bmHeight
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment