Commit 1418cd79 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdiplus: GdipMeasureCharacterRanges shouldn't treat empty layout rectangle as infinite bounds.

parent 32d37c83
......@@ -4731,9 +4731,6 @@ GpStatus gdip_format_string(HDC hdc,
nwidth = rect->Width;
nheight = rect->Height;
if (rect->Width >= INT_MAX || rect->Width < 0.5) nwidth = INT_MAX;
if (rect->Height >= INT_MAX || rect->Height < 0.5) nheight = INT_MAX;
if (format)
hkprefix = format->hkprefix;
else
......@@ -5064,6 +5061,9 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics,
scaled_rect.Width = rect->Width * args.rel_width;
scaled_rect.Height = rect->Height * args.rel_height;
if (scaled_rect.Width >= INT_MAX || scaled_rect.Width < 0.5) scaled_rect.Width = (REAL)(1 << 23);
if (scaled_rect.Height >= INT_MAX || scaled_rect.Height < 0.5) scaled_rect.Height = (REAL)(1 << 23);
bounds->X = rect->X;
bounds->Y = rect->Y;
bounds->Width = 0.0;
......@@ -5214,6 +5214,9 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
scaled_rect.Width = rel_width * rect->Width;
scaled_rect.Height = rel_height * rect->Height;
if (scaled_rect.Width >= INT_MAX || scaled_rect.Width < 0.5) scaled_rect.Width = (REAL)(1 << 23);
if (scaled_rect.Height >= INT_MAX || scaled_rect.Height < 0.5) scaled_rect.Height = (REAL)(1 << 23);
if (gdip_round(scaled_rect.Width) != 0 && gdip_round(scaled_rect.Height) != 0)
{
/* FIXME: If only the width or only the height is 0, we should probably still clip */
......
......@@ -3140,11 +3140,8 @@ static void test_string_functions(void)
expect(Ok, status);
}
todo_wine
ok(region_isempty[0], "region should be empty\n");
todo_wine
ok(region_isempty[1], "region should be empty\n");
todo_wine
ok(region_isempty[2], "region should be empty\n");
ok(region_isempty[3], "region should be empty\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment