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
aa9602db
Commit
aa9602db
authored
Jun 29, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Jun 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement horizontal alignment in GdipDrawString.
parent
3ca49a10
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
graphics.c
dlls/gdiplus/graphics.c
+25
-5
No files found.
dlls/gdiplus/graphics.c
View file @
aa9602db
...
...
@@ -2098,6 +2098,8 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
INT
sum
=
0
,
height
=
0
,
offsety
=
0
,
fit
,
fitcpy
,
save_state
,
i
,
j
,
lret
,
nwidth
,
nheight
;
SIZE
size
;
POINT
drawbase
;
UINT
drawflags
;
RECT
drawcoord
;
TRACE
(
"(%p, %s, %i, %p, %s, %p, %p)
\n
"
,
graphics
,
debugstr_wn
(
string
,
length
),
...
...
@@ -2207,17 +2209,35 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
length
=
j
;
if
(
format
->
align
==
StringAlignmentNear
)
{
drawbase
.
x
=
corners
[
0
].
x
;
drawbase
.
y
=
corners
[
0
].
y
;
drawflags
=
DT_NOCLIP
|
DT_EXPANDTABS
;
}
else
if
(
format
->
align
==
StringAlignmentCenter
)
{
drawbase
.
x
=
(
corners
[
0
].
x
+
corners
[
1
].
x
)
/
2
;
drawbase
.
y
=
(
corners
[
0
].
y
+
corners
[
1
].
y
)
/
2
;
drawflags
=
DT_NOCLIP
|
DT_EXPANDTABS
|
DT_CENTER
;
}
else
/* (format->align == StringAlignmentFar) */
{
drawbase
.
x
=
corners
[
1
].
x
;
drawbase
.
y
=
corners
[
1
].
y
;
drawflags
=
DT_NOCLIP
|
DT_EXPANDTABS
|
DT_RIGHT
;
}
while
(
sum
<
length
){
drawcoord
.
left
=
corners
[
0
]
.
x
+
roundr
(
ang_sin
*
(
REAL
)
height
);
drawcoord
.
top
=
corners
[
0
]
.
y
+
roundr
(
ang_cos
*
(
REAL
)
height
);
drawcoord
.
left
=
drawcoord
.
right
=
drawbase
.
x
+
roundr
(
ang_sin
*
(
REAL
)
height
);
drawcoord
.
top
=
drawcoord
.
bottom
=
drawbase
.
y
+
roundr
(
ang_cos
*
(
REAL
)
height
);
GetTextExtentExPointW
(
graphics
->
hdc
,
stringdup
+
sum
,
length
-
sum
,
nwidth
,
&
fit
,
NULL
,
&
size
);
fitcpy
=
fit
;
if
(
fit
==
0
){
DrawTextW
(
graphics
->
hdc
,
stringdup
+
sum
,
1
,
&
drawcoord
,
DT_NOCLIP
|
DT_EXPANDTABS
);
DrawTextW
(
graphics
->
hdc
,
stringdup
+
sum
,
1
,
&
drawcoord
,
drawflags
);
break
;
}
...
...
@@ -2246,7 +2266,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
}
}
DrawTextW
(
graphics
->
hdc
,
stringdup
+
sum
,
min
(
length
-
sum
,
fit
),
&
drawcoord
,
DT_NOCLIP
|
DT_EXPANDTABS
);
&
drawcoord
,
drawflags
);
sum
+=
fit
+
(
lret
<
fitcpy
?
1
:
0
);
height
+=
size
.
cy
;
...
...
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