mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 04:00:56 +00:00
gdiplus: Round width and height in gdip_format_string().
This commit is contained in:
parent
65f7d5ec48
commit
5415eb7c37
|
@ -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.005f);
|
||||
nheight = (int)(rect->Height + 0.005f);
|
||||
if (ignore_empty_clip)
|
||||
{
|
||||
if (!nwidth) nwidth = INT_MAX;
|
||||
|
|
|
@ -4770,7 +4770,7 @@ static void test_measure_string(void)
|
|||
|
||||
set_rect_empty(&rect);
|
||||
rect.Height = height;
|
||||
rect.Width = width_2 - 0.05;
|
||||
rect.Width = width_2 - 0.006;
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue