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.
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..9e9e7fe0df9 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; } 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=148801
Your paranoid android.
=== debian11b (64 bit WoW report) ===
mf: mf.c:5383: Test failed: got hr 0x800c0008
urlmon: protocol.c:1198: Test failed: hrResult = 800c0008, expected: 00000000 protocol.c:1203: Test failed: dwError == ERROR_SUCCESS
user32: msg.c:6935: Test failed: SetFocus(hwnd) on a button: 3: the winevent_hook 0x8005 was expected, but got hook 0x0005 instead msg.c:6935: Test failed: SetFocus(hwnd) on a button: 3: the winevent_hook 0x8005 was expected, but got winevent_hook 0x0003 instead msg.c:6935: Test failed: SetFocus(hwnd) on a button: 3: the winevent_hook 0x8005 was expected, but got msg 0x030f instead msg.c:6935: Test failed: SetFocus(hwnd) on a button: 3: the winevent_hook 0x8005 was expected, but got msg 0x001c instead msg.c:6935: Test failed: SetFocus(hwnd) on a button: 3: the winevent_hook 0x8005 was expected, but got msg 0x0086 instead msg.c:6935: Test failed: SetFocus(hwnd) on a button: 3: the winevent_hook 0x8005 was expected, but got msg 0x0006 instead msg.c:6935: Test failed: SetFocus(hwnd) on a button: 3: the winevent_hook 0x8005 was expected, but got hook 0x0009 instead msg.c:12615: Test failed: Got expected 0. msg.c:12630: Test failed: Got expected 0.
This has some weird side-effects. Sometimes, when more than one line fits, it seems to make the bounding box larger than what was passed in. Used the attached program to test. [measuretext.c](/uploads/e5740a9788b947a7234311dd0b07d018/measuretext.c)