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
ca918253
Commit
ca918253
authored
Oct 11, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Clarify where extra Y margin added by GdipMeasureString comes from.
parent
608a936a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
graphics.c
dlls/gdiplus/tests/graphics.c
+11
-6
No files found.
dlls/gdiplus/tests/graphics.c
View file @
ca918253
...
@@ -3821,17 +3821,25 @@ static void test_font_height_scaling(void)
...
@@ -3821,17 +3821,25 @@ static void test_font_height_scaling(void)
{
{
static
const
WCHAR
doubleW
[
2
]
=
{
'W'
,
'W'
};
static
const
WCHAR
doubleW
[
2
]
=
{
'W'
,
'W'
};
RectF
bounds_1
,
bounds_2
;
RectF
bounds_1
,
bounds_2
;
REAL
margin
;
REAL
margin
,
margin_y
,
font_height
;
int
match
;
int
match
;
status
=
GdipSetPageUnit
(
graphics
,
gfx_unit
);
status
=
GdipSetPageUnit
(
graphics
,
gfx_unit
);
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
margin_y
=
units_to_pixels
(
height
/
8
.
0
,
font_unit
,
dpi
);
margin_y
=
pixels_to_units
(
margin_y
,
gfx_unit
,
dpi
);
status
=
GdipGetFontHeight
(
font
,
graphics
,
&
font_height
);
expect
(
Ok
,
status
);
set_rect_empty
(
&
rect
);
set_rect_empty
(
&
rect
);
set_rect_empty
(
&
bounds
);
set_rect_empty
(
&
bounds
);
status
=
GdipMeasureString
(
graphics
,
string
,
-
1
,
font
,
&
rect
,
format
,
&
bounds
,
NULL
,
NULL
);
status
=
GdipMeasureString
(
graphics
,
string
,
-
1
,
font
,
&
rect
,
format
,
&
bounds
,
NULL
,
NULL
);
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
/*trace("bounds: %f,%f,%f,%f\n", bounds.X, bounds.Y, bounds.Width, bounds.Height);*/
/*trace("bounds: %f,%f,%f,%f\n", bounds.X, bounds.Y, bounds.Width, bounds.Height);*/
todo_wine
expectf_
(
font_height
+
margin_y
,
bounds
.
Height
,
0
.
005
);
ptf
.
X
=
0
;
ptf
.
X
=
0
;
ptf
.
Y
=
bounds
.
Height
;
ptf
.
Y
=
bounds
.
Height
;
...
@@ -3864,9 +3872,6 @@ todo_wine
...
@@ -3864,9 +3872,6 @@ todo_wine
/*trace("margin %f\n", margin);*/
/*trace("margin %f\n", margin);*/
ok
(
margin
>
0
.
0
,
"wrong margin %f
\n
"
,
margin
);
ok
(
margin
>
0
.
0
,
"wrong margin %f
\n
"
,
margin
);
status
=
GdipGetFontHeight
(
font
,
graphics
,
&
height
);
expect
(
Ok
,
status
);
set_rect_empty
(
&
rect
);
set_rect_empty
(
&
rect
);
rect
.
Width
=
320000
.
0
;
rect
.
Width
=
320000
.
0
;
rect
.
Height
=
320000
.
0
;
rect
.
Height
=
320000
.
0
;
...
@@ -3880,9 +3885,9 @@ todo_wine
...
@@ -3880,9 +3885,9 @@ todo_wine
expectf
(
0
.
0
,
rect
.
Y
);
expectf
(
0
.
0
,
rect
.
Y
);
match
=
fabs
(
1
.
0
-
margin
/
rect
.
X
)
<=
0
.
05
;
match
=
fabs
(
1
.
0
-
margin
/
rect
.
X
)
<=
0
.
05
;
ok
(
match
,
"Expected %f, got %f
\n
"
,
margin
,
rect
.
X
);
ok
(
match
,
"Expected %f, got %f
\n
"
,
margin
,
rect
.
X
);
match
=
fabs
(
1
.
0
-
height
/
rect
.
Height
)
<=
0
.
1
;
match
=
fabs
(
1
.
0
-
font_
height
/
rect
.
Height
)
<=
0
.
1
;
todo_wine
todo_wine
ok
(
match
,
"Expected %f, got %f
\n
"
,
height
,
rect
.
Height
);
ok
(
match
,
"Expected %f, got %f
\n
"
,
font_
height
,
rect
.
Height
);
match
=
fabs
(
1
.
0
-
bounds
.
Width
/
(
rect
.
Width
+
margin
*
2
.
0
))
<=
0
.
05
;
match
=
fabs
(
1
.
0
-
bounds
.
Width
/
(
rect
.
Width
+
margin
*
2
.
0
))
<=
0
.
05
;
ok
(
match
,
"Expected %f, got %f
\n
"
,
bounds
.
Width
,
rect
.
Width
+
margin
*
2
.
0
);
ok
(
match
,
"Expected %f, got %f
\n
"
,
bounds
.
Width
,
rect
.
Width
+
margin
*
2
.
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