Dmitry Timoshkov : gdiplus: GdipMeasureCharacterRanges shouldn' t treat empty layout rectangle as infinite bounds.
Alexandre Julliard
julliard at winehq.org
Wed Aug 22 14:04:20 CDT 2012
Module: wine
Branch: master
Commit: 1418cd796cf00636db3e75df25645e235a1a845d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1418cd796cf00636db3e75df25645e235a1a845d
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Wed Aug 22 15:34:38 2012 +0900
gdiplus: GdipMeasureCharacterRanges shouldn't treat empty layout rectangle as infinite bounds.
---
dlls/gdiplus/graphics.c | 9 ++++++---
dlls/gdiplus/tests/graphics.c | 3 ---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 28fc570..785c44e 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -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 */
diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c
index c95bf11..b3509a2 100644
--- a/dlls/gdiplus/tests/graphics.c
+++ b/dlls/gdiplus/tests/graphics.c
@@ -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");
More information about the wine-cvs
mailing list