From: James McDonnell topgamer7@gmail.com
This resolves the issue in StudioTax where the bounding box dimensions is reported as 0. Because the height is less than 0, the check for height in GdipAddPathRectangle fails, and the X and Y coordinates of the points is never set. --- dlls/gdiplus/graphics.c | 6 ++++-- dlls/gdiplus/tests/graphics.c | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 0727b63ed4f..9de0c302c3b 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -5448,11 +5448,11 @@ GpStatus gdip_format_string(GpGraphics *graphics, HDC hdc,
bounds.Width = size.cx;
- if(height + size.cy > nheight) + if(height + size.cy > nheight && (format->attr & StringFormatFlagsNoClip) == 0) { if (format->attr & StringFormatFlagsLineLimit) break; - bounds.Height = nheight - (height + size.cy); + bounds.Height = nheight - height; } else bounds.Height = size.cy; @@ -5516,6 +5516,8 @@ GpStatus gdip_format_string(GpGraphics *graphics, HDC hdc, free(stringdup); free(hotkeyprefix_offsets);
+ TRACE("%s bounds %s \n", debugstr_wn(string, length), debugstr_rectf(&bounds)); + return stat; }
diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 4af7f179ec2..651c3b32e51 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -4667,7 +4667,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; @@ -4786,7 +4785,6 @@ static void test_measure_string(void) expectf(0.0, bounds.X); expectf(0.0, bounds.Y); expectf_(width, bounds.Width, 0.01); - todo_wine expectf(height, bounds.Height);
set_rect_empty(&rect);