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
d1099eb4
Commit
d1099eb4
authored
Sep 25, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Sep 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Invert y in DrawTextEx in GM_COMPATIBLE mode if y increases up.
parent
575ee0bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
text.c
dlls/user32/tests/text.c
+1
-1
text.c
dlls/user32/text.c
+18
-2
No files found.
dlls/user32/tests/text.c
View file @
d1099eb4
...
...
@@ -80,7 +80,7 @@ static void test_DrawTextCalcRect(void)
ok
(
textheight
,
"DrawTextA error %u
\n
"
,
GetLastError
());
trace
(
"MM_HIENGLISH rect.bottom %d
\n
"
,
rect
.
bottom
);
todo_wine
ok
(
rect
.
bottom
<
0
,
"In MM_HIENGLISH, DrawText with "
ok
(
rect
.
bottom
<
0
,
"In MM_HIENGLISH, DrawText with "
"DT_CALCRECT should return a negative rectangle bottom. "
"(bot=%d)
\n
"
,
rect
.
bottom
);
...
...
dlls/user32/text.c
View file @
d1099eb4
...
...
@@ -855,6 +855,7 @@ INT WINAPI DrawTextExW( HDC hdc, LPWSTR str, INT i_count,
int
tabwidth
/* to keep gcc happy */
=
0
;
int
prefix_offset
;
ellipsis_data
ellip
;
int
invert_y
=
0
;
TRACE
(
"%s, %d, [%s] %08x
\n
"
,
debugstr_wn
(
str
,
count
),
count
,
wine_dbgstr_rect
(
rect
),
flags
);
...
...
@@ -898,6 +899,15 @@ INT WINAPI DrawTextExW( HDC hdc, LPWSTR str, INT i_count,
}
}
if
(
GetGraphicsMode
(
hdc
)
==
GM_COMPATIBLE
)
{
SIZE
window_ext
,
viewport_ext
;
GetWindowExtEx
(
hdc
,
&
window_ext
);
GetViewportExtEx
(
hdc
,
&
viewport_ext
);
if
((
window_ext
.
cy
>
0
)
!=
(
viewport_ext
.
cy
>
0
))
invert_y
=
1
;
}
if
(
dtp
)
{
lmargin
=
dtp
->
iLeftMargin
;
...
...
@@ -932,7 +942,10 @@ INT WINAPI DrawTextExW( HDC hdc, LPWSTR str, INT i_count,
do
{
len
=
sizeof
(
line
)
/
sizeof
(
line
[
0
]);
last_line
=
!
(
flags
&
DT_NOCLIP
)
&&
y
+
((
flags
&
DT_EDITCONTROL
)
?
2
*
lh
-
1
:
lh
)
>
rect
->
bottom
;
if
(
invert_y
)
last_line
=
!
(
flags
&
DT_NOCLIP
)
&&
y
-
((
flags
&
DT_EDITCONTROL
)
?
2
*
lh
-
1
:
lh
)
<
rect
->
bottom
;
else
last_line
=
!
(
flags
&
DT_NOCLIP
)
&&
y
+
((
flags
&
DT_EDITCONTROL
)
?
2
*
lh
-
1
:
lh
)
>
rect
->
bottom
;
strPtr
=
TEXT_NextLineW
(
hdc
,
strPtr
,
&
count
,
line
,
&
len
,
width
,
flags
,
&
size
,
last_line
,
&
p_retstr
,
tabwidth
,
&
prefix_offset
,
&
ellip
);
if
(
flags
&
DT_CENTER
)
x
=
(
rect
->
left
+
rect
->
right
-
...
...
@@ -1001,7 +1014,10 @@ INT WINAPI DrawTextExW( HDC hdc, LPWSTR str, INT i_count,
else
if
(
size
.
cx
>
max_width
)
max_width
=
size
.
cx
;
y
+=
lh
;
if
(
invert_y
)
y
-=
lh
;
else
y
+=
lh
;
if
(
dtp
)
dtp
->
uiLengthDrawn
+=
len
;
}
...
...
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