Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
3fc25446
Commit
3fc25446
authored
Jun 04, 2003
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Jun 04, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DrawTextEx: honor clipping for underscores.
parent
8e07797c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
text.c
dlls/user/text.c
+12
-2
No files found.
dlls/user/text.c
View file @
3fc25446
...
...
@@ -792,9 +792,10 @@ static const WCHAR *TEXT_NextLineW( HDC hdc, const WCHAR *str, int *count,
* (logical coordinates)
* str [in] The text of the line segment
* offset [in] The offset of the underscored character within str
* rect [in] Clipping rectangle (if not NULL)
*/
static
void
TEXT_DrawUnderscore
(
HDC
hdc
,
int
x
,
int
y
,
const
WCHAR
*
str
,
int
offset
)
static
void
TEXT_DrawUnderscore
(
HDC
hdc
,
int
x
,
int
y
,
const
WCHAR
*
str
,
int
offset
,
const
RECT
*
rect
)
{
int
prefix_x
;
int
prefix_end
;
...
...
@@ -808,6 +809,15 @@ static void TEXT_DrawUnderscore (HDC hdc, int x, int y, const WCHAR *str, int of
prefix_end
=
x
+
size
.
cx
-
1
;
/* The above method may eventually be slightly wrong due to kerning etc. */
/* Check for clipping */
if
(
rect
){
if
(
prefix_x
>
rect
->
right
||
prefix_end
<
rect
->
left
||
y
<
rect
->
top
||
y
>
rect
->
bottom
)
return
;
/* Completely outside */
/* Partially outside */
if
(
prefix_x
<
rect
->
left
)
prefix_x
=
rect
->
left
;
if
(
prefix_end
>
rect
->
right
)
prefix_end
=
rect
->
right
;
}
hpen
=
CreatePen
(
PS_SOLID
,
1
,
GetTextColor
(
hdc
));
oldPen
=
SelectObject
(
hdc
,
hpen
);
MoveToEx
(
hdc
,
prefix_x
,
y
,
NULL
);
...
...
@@ -939,7 +949,7 @@ INT WINAPI DrawTextExW( HDC hdc, LPWSTR str, INT i_count,
rect
,
str
,
len_seg
,
NULL
))
return
0
;
if
(
prefix_offset
!=
-
1
&&
prefix_offset
<
len_seg
)
{
TEXT_DrawUnderscore
(
hdc
,
xseg
,
y
+
tm
.
tmAscent
+
1
,
str
,
prefix_offset
);
TEXT_DrawUnderscore
(
hdc
,
xseg
,
y
+
tm
.
tmAscent
+
1
,
str
,
prefix_offset
,
(
flags
&
DT_NOCLIP
)
?
NULL
:
rect
);
}
len
-=
len_seg
;
str
+=
len_seg
;
...
...
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