gdiplus: GdipMeasureCharacterRanges shouldn't treat empty layout rectangle as infinite bounds.
This commit is contained in:
parent
32d37c832d
commit
1418cd796c
|
@ -4731,9 +4731,6 @@ GpStatus gdip_format_string(HDC hdc,
|
||||||
nwidth = rect->Width;
|
nwidth = rect->Width;
|
||||||
nheight = rect->Height;
|
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)
|
if (format)
|
||||||
hkprefix = format->hkprefix;
|
hkprefix = format->hkprefix;
|
||||||
else
|
else
|
||||||
|
@ -5064,6 +5061,9 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics,
|
||||||
scaled_rect.Width = rect->Width * args.rel_width;
|
scaled_rect.Width = rect->Width * args.rel_width;
|
||||||
scaled_rect.Height = rect->Height * args.rel_height;
|
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->X = rect->X;
|
||||||
bounds->Y = rect->Y;
|
bounds->Y = rect->Y;
|
||||||
bounds->Width = 0.0;
|
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.Width = rel_width * rect->Width;
|
||||||
scaled_rect.Height = rel_height * rect->Height;
|
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)
|
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 */
|
/* 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);
|
expect(Ok, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
todo_wine
|
|
||||||
ok(region_isempty[0], "region should be empty\n");
|
ok(region_isempty[0], "region should be empty\n");
|
||||||
todo_wine
|
|
||||||
ok(region_isempty[1], "region should be empty\n");
|
ok(region_isempty[1], "region should be empty\n");
|
||||||
todo_wine
|
|
||||||
ok(region_isempty[2], "region should be empty\n");
|
ok(region_isempty[2], "region should be empty\n");
|
||||||
ok(region_isempty[3], "region should be empty\n");
|
ok(region_isempty[3], "region should be empty\n");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue