Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45698
Signed-off-by: David Kahurani k.kahurani@gmail.com
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;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=128805
Your paranoid android.
=== debian11 (32 bit report) ===
gdiplus: graphics.c:3350: Test failed: Expected 48.000000, got 60.000000
=== debian11 (32 bit zh:CN report) ===
gdiplus: graphics.c:3350: Test failed: Expected 48.000000, got 60.000000
=== debian11b (64 bit WoW report) ===
gdiplus: graphics.c:3350: Test failed: Expected 48.000000, got 60.000000