When passing a box with a non-zero height that is smaller than the bounding box to GdipMeasureString, it returns a bounding box of 0. In Windows it returns the same height as the box.
-- v2: gdiplus: Assign box height when bounding box height is larger.
From: Santino Mazza smazza@codeweavers.com
--- dlls/gdiplus/graphics.c | 2 +- dlls/gdiplus/tests/graphics.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index f7559201c59..0574f6e8aba 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -5602,7 +5602,7 @@ GpStatus gdip_format_string(GpGraphics *graphics, HDC hdc, { if (format->attr & StringFormatFlagsLineLimit) break; - bounds.Height = nheight - (height + size.cy); + bounds.Height = nheight - height; } else bounds.Height = size.cy; diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index a7efec723ab..dd25dd54fb2 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -4677,7 +4677,6 @@ static void test_measure_string(void) expectf(0.0, bounds.X); expectf(0.0, bounds.Y); expectf(width, bounds.Width); - todo_wine expectf(height / 2.0, bounds.Height);
range.First = 0;
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=148866
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000005900D6, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032
Ah, makes sense. I was just assigning the box height, so when a multi line string is measured it will just add the box height again, now I only add the part of the box that is left.
This merge request was approved by Esme Povirk.