From fe000c773ce89961a4dcfbf6eee75c5833911539 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 21 Jun 2012 15:51:37 -0500 Subject: [PATCH] gdiplus: Fix vertical alignment calculation in GdipAddPathString. --- dlls/gdiplus/graphicspath.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index df9613dbe2e..471f91585b8 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -1008,12 +1008,12 @@ GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT } if (format && format->vertalign == StringAlignmentCenter && layoutRect->Y + args.maxY < layoutRect->Height) { - float inc = layoutRect->Height - args.maxY - layoutRect->Y; + float inc = layoutRect->Height + layoutRect->Y - args.maxY; inc /= 2; for (i = backup->pathdata.Count; i < path->pathdata.Count; ++i) path->pathdata.Points[i].Y += inc; } else if (format && format->vertalign == StringAlignmentFar) { - float inc = layoutRect->Height - args.maxY - layoutRect->Y; + float inc = layoutRect->Height + layoutRect->Y - args.maxY; for (i = backup->pathdata.Count; i < path->pathdata.Count; ++i) path->pathdata.Points[i].Y += inc; }