From: David Kahurani k.kahurani@gmail.com
Always loop through the whole string and also treat each call to format_string_callback as a line written for any string that contains non-whitespace characters.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45698
Signed-off-by: David Kahurani k.kahurani@gmail.com --- dlls/gdiplus/graphics.c | 5 +++-- dlls/gdiplus/graphicspath.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index fca66c8654b..7ebebf417a4 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -5176,7 +5176,7 @@ GpStatus gdip_format_string(HDC hdc, { WCHAR* stringdup; int sum = 0, height = 0, fit, fitcpy, i, j, lret, nwidth, - nheight, lineend, lineno = 0; + nheight, lineend, lineno = 0, lineheight; RectF bounds; StringAlignment halign; GpStatus stat = Ok; @@ -5254,6 +5254,7 @@ GpStatus gdip_format_string(HDC hdc, GetTextExtentExPointW(hdc, stringdup + sum, length - sum, nwidth, &fit, NULL, &size); fitcpy = fit; + lineheight = size.cy;
if(fit == 0) break; @@ -5332,7 +5333,7 @@ GpStatus gdip_format_string(HDC hdc, break;
sum += fit + (lret < fitcpy ? 1 : 0); - height += size.cy; + height += lineheight; lineno++;
hotkeyprefix_pos = hotkeyprefix_end_pos; diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 2e30300e348..656069d7ffe 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -908,7 +908,7 @@ static GpStatus format_string_callback(HDC dc, if (y + bounds->Height * args->scale > args->maxY) args->maxY = y + bounds->Height * args->scale;
- for (i = index; i < length; ++i) + for (i = index; i < length + index; ++i) { GLYPHMETRICS gm; TTPOLYGONHEADER *ph = NULL, *origph;