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
209820c4
Commit
209820c4
authored
Feb 02, 2009
by
Ulrich Czekalla
Committed by
Alexandre Julliard
Feb 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Don't scale draw text margin params by character width units.
Values passed in DRAWTEXTPARAMS are already in average character width units.
parent
a1f05593
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
text.c
dlls/user32/tests/text.c
+17
-0
text.c
dlls/user32/text.c
+2
-2
No files found.
dlls/user32/tests/text.c
View file @
209820c4
...
...
@@ -316,6 +316,23 @@ static void test_DrawTextCalcRect(void)
ok
(
textheight
==
0
,
"Got textheight from DrawTextExA
\n
"
);
ok
(
dtp
.
uiLengthDrawn
==
1337
,
"invalid dtp.uiLengthDrawn = %i
\n
"
,
dtp
.
uiLengthDrawn
);
/* Margin calculations */
dtp
.
cbSize
=
sizeof
(
dtp
);
dtp
.
iLeftMargin
=
0
;
dtp
.
iRightMargin
=
0
;
SetRect
(
&
rect
,
0
,
0
,
0
,
0
);
DrawTextExA
(
hdc
,
text
,
-
1
,
&
rect
,
DT_CALCRECT
,
&
dtp
);
textlen
=
rect
.
right
;
/* Width without margin */
dtp
.
iLeftMargin
=
8
;
SetRect
(
&
rect
,
0
,
0
,
0
,
0
);
DrawTextExA
(
hdc
,
text
,
-
1
,
&
rect
,
DT_CALCRECT
,
&
dtp
);
ok
(
rect
.
right
==
dtp
.
iLeftMargin
+
textlen
,
"Incorrect left margin calculated rc(%d,%d)
\n
"
,
rect
.
left
,
rect
.
right
);
dtp
.
iLeftMargin
=
0
;
dtp
.
iRightMargin
=
8
;
SetRect
(
&
rect
,
0
,
0
,
0
,
0
);
DrawTextExA
(
hdc
,
text
,
-
1
,
&
rect
,
DT_CALCRECT
,
&
dtp
);
ok
(
rect
.
right
==
dtp
.
iRightMargin
+
textlen
,
"Incorrect right margin calculated rc(%d,%d)
\n
"
,
rect
.
left
,
rect
.
right
);
/* Wide char versions */
SetRect
(
&
rect
,
10
,
10
,
100
,
100
);
SetLastError
(
0
);
...
...
dlls/user32/text.c
View file @
209820c4
...
...
@@ -900,8 +900,8 @@ INT WINAPI DrawTextExW( HDC hdc, LPWSTR str, INT i_count,
if
(
dtp
)
{
lmargin
=
dtp
->
iLeftMargin
*
tm
.
tmAveCharWidth
;
rmargin
=
dtp
->
iRightMargin
*
tm
.
tmAveCharWidth
;
lmargin
=
dtp
->
iLeftMargin
;
rmargin
=
dtp
->
iRightMargin
;
if
(
!
(
flags
&
(
DT_CENTER
|
DT_RIGHT
)))
x
+=
lmargin
;
dtp
->
uiLengthDrawn
=
0
;
/* This param RECEIVES number of chars processed */
...
...
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