gdiplus: Fix vertical alignment calculation in GdipAddPathString.

This commit is contained in:
Vincent Povirk 2012-06-21 15:51:37 -05:00 committed by Alexandre Julliard
parent 3cde67e144
commit fe000c773c
1 changed files with 2 additions and 2 deletions

View File

@ -1008,12 +1008,12 @@ GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT
} }
if (format && format->vertalign == StringAlignmentCenter && layoutRect->Y + args.maxY < layoutRect->Height) 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; inc /= 2;
for (i = backup->pathdata.Count; i < path->pathdata.Count; ++i) for (i = backup->pathdata.Count; i < path->pathdata.Count; ++i)
path->pathdata.Points[i].Y += inc; path->pathdata.Points[i].Y += inc;
} else if (format && format->vertalign == StringAlignmentFar) { } 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) for (i = backup->pathdata.Count; i < path->pathdata.Count; ++i)
path->pathdata.Points[i].Y += inc; path->pathdata.Points[i].Y += inc;
} }