From: Dmitry Timoshkov dmitry@baikal.ru
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57036 Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/gdiplus/graphics.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index bdb2e1c917c..bc4e759eee3 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -5912,7 +5912,11 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, if (scaled_rect.Width >= 0.5) { scaled_rect.Width -= margin_x * 2.0 * args.rel_width; - if (scaled_rect.Width < 0.5) return Ok; /* doesn't fit */ + if (scaled_rect.Width < 0.5) + { + status = Ok; /* doesn't fit */ + goto end; + } }
if (scaled_rect.Width >= 1 << 23) scaled_rect.Width = 1 << 23; @@ -5943,7 +5947,7 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics,
SelectObject(hdc, oldfont); DeleteObject(gdifont); - +end: if (temp_hdc) DeleteDC(temp_hdc); else @@ -6091,7 +6095,11 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string if (scaled_rect.Width >= 0.5) { scaled_rect.Width -= margin_x * 2.0 * rel_width; - if (scaled_rect.Width < 0.5) return Ok; /* doesn't fit */ + if (scaled_rect.Width < 0.5) + { + status = Ok; /* doesn't fit */ + goto end; + } }
if (scaled_rect.Width >= 1 << 23) scaled_rect.Width = 1 << 23; @@ -6129,7 +6137,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
DeleteObject(rgn); DeleteObject(gdifont); - +end: RestoreDC(hdc, save_state);
if (temp_hdc)