From: Dmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> --- dlls/gdiplus/graphics.c | 17 +++++++++++++++-- dlls/gdiplus/tests/graphics.c | 4 ---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index a9aa56bf063..f282ab447a4 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -5966,10 +5966,23 @@ static GpStatus measure_string_callback(struct gdip_format_string_info *info) default: break; case StringAlignmentCenter: - bounds->X = bounds->X + (info->rect->Width/2) - (bounds->Width/2); + bounds->X += (info->rect->Width - bounds->Width) / 2; break; case StringAlignmentFar: - bounds->X = bounds->X + info->rect->Width - bounds->Width; + bounds->X += info->rect->Width - bounds->Width; + break; + } + + switch (info->format->line_align) + { + case StringAlignmentNear: + default: + break; + case StringAlignmentCenter: + bounds->Y += (info->rect->Height - bounds->Height) / 2; + break; + case StringAlignmentFar: + bounds->Y += info->rect->Height - bounds->Height; break; } diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 96ef52ce935..e1c99e98080 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -4921,7 +4921,6 @@ static void test_measure_string(void) expect(3, glyphs); expect(1, lines); expectf_(5.0 + width/2.0, bounds.X, 0.01); - todo_wine expectf(5.0 + height/2.0, bounds.Y); expectf_(width, bounds.Width, 0.01); expectf(height, bounds.Height); @@ -4937,7 +4936,6 @@ static void test_measure_string(void) expect(1, lines); todo_wine expectf_(5.0 - width/2.0, bounds.X, 0.01); - todo_wine expectf(5.0 - height/2.0, bounds.Y); expectf_(width, bounds.Width, 0.01); expectf(height, bounds.Height); @@ -4988,7 +4986,6 @@ static void test_measure_string(void) expect(3, glyphs); expect(1, lines); expectf_(5.0 + width, bounds.X, 0.01); - todo_wine expectf(5.0 + height, bounds.Y); expectf_(width, bounds.Width, 0.01); expectf(height, bounds.Height); @@ -5004,7 +5001,6 @@ static void test_measure_string(void) expect(1, lines); todo_wine expectf_(5.0 - width, bounds.X, 0.01); - todo_wine expectf(5.0 - height, bounds.Y); expectf_(width, bounds.Width, 0.01); expectf(height, bounds.Height); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9775