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
5415eb7c
Commit
5415eb7c
authored
Nov 16, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Nov 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Round width and height in gdip_format_string().
parent
65f7d5ec
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
graphics.c
dlls/gdiplus/graphics.c
+2
-2
graphics.c
dlls/gdiplus/tests/graphics.c
+14
-1
No files found.
dlls/gdiplus/graphics.c
View file @
5415eb7c
...
...
@@ -5179,8 +5179,8 @@ GpStatus gdip_format_string(HDC hdc,
if
(
!
format
)
format
=
&
default_drawstring_format
;
nwidth
=
rect
->
Width
;
nheight
=
rect
->
Height
;
nwidth
=
(
int
)(
rect
->
Width
+
0
.
005
f
)
;
nheight
=
(
int
)(
rect
->
Height
+
0
.
005
f
)
;
if
(
ignore_empty_clip
)
{
if
(
!
nwidth
)
nwidth
=
INT_MAX
;
...
...
dlls/gdiplus/tests/graphics.c
View file @
5415eb7c
...
...
@@ -4770,7 +4770,7 @@ static void test_measure_string(void)
set_rect_empty
(
&
rect
);
rect
.
Height
=
height
;
rect
.
Width
=
width_2
-
0
.
0
5
;
rect
.
Width
=
width_2
-
0
.
0
06
;
set_rect_empty
(
&
bounds
);
status
=
GdipMeasureString
(
graphics
,
string
,
-
1
,
font
,
&
rect
,
format
,
&
bounds
,
&
glyphs
,
&
lines
);
expect
(
Ok
,
status
);
...
...
@@ -4781,6 +4781,19 @@ static void test_measure_string(void)
expectf_
(
width_1
,
bounds
.
Width
,
0
.
01
);
expectf
(
height
,
bounds
.
Height
);
set_rect_empty
(
&
rect
);
rect
.
Height
=
height
;
rect
.
Width
=
width_2
-
0
.
004
;
set_rect_empty
(
&
bounds
);
status
=
GdipMeasureString
(
graphics
,
string
,
-
1
,
font
,
&
rect
,
format
,
&
bounds
,
&
glyphs
,
&
lines
);
expect
(
Ok
,
status
);
expect
(
2
,
glyphs
);
expect
(
1
,
lines
);
expectf
(
0
.
0
,
bounds
.
X
);
expectf
(
0
.
0
,
bounds
.
Y
);
expectf_
(
width_2
,
bounds
.
Width
,
0
.
01
);
expectf
(
height
,
bounds
.
Height
);
/* Default (Near) alignment */
rect
.
X
=
5
.
0
;
rect
.
Y
=
5
.
0
;
...
...
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