gdiplus: Use better naming for line alignment format field.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-04-28 01:20:32 +03:00 committed by Alexandre Julliard
parent 69b41e7cf3
commit c89de1dd08
4 changed files with 9 additions and 9 deletions

View File

@ -450,7 +450,7 @@ struct GpStringFormat{
StringAlignment align;
StringTrimming trimming;
HotkeyPrefix hkprefix;
StringAlignment vertalign;
StringAlignment line_align;
StringDigitSubstitute digitsub;
INT tabcount;
REAL firsttab;

View File

@ -5417,19 +5417,19 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
/* Should be no need to explicitly test for StringAlignmentNear as
* that is default behavior if no alignment is passed. */
if(format->vertalign != StringAlignmentNear){
if(format->line_align != StringAlignmentNear){
RectF bounds, in_rect = *rect;
in_rect.Height = 0.0; /* avoid height clipping */
GdipMeasureString(graphics, string, length, font, &in_rect, format, &bounds, 0, 0);
TRACE("bounds %s\n", debugstr_rectf(&bounds));
if(format->vertalign == StringAlignmentCenter)
if(format->line_align == StringAlignmentCenter)
offsety = (rect->Height - bounds.Height) / 2;
else if(format->vertalign == StringAlignmentFar)
else if(format->line_align == StringAlignmentFar)
offsety = (rect->Height - bounds.Height);
}
TRACE("vertical align %d, offsety %f\n", format->vertalign, offsety);
TRACE("line align %d, offsety %f\n", format->line_align, offsety);
}
save_state = SaveDC(hdc);

View File

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

View File

@ -178,7 +178,7 @@ GpStatus WINGDIPAPI GdipGetStringFormatLineAlign(GpStringFormat *format,
if(!format || !align)
return InvalidParameter;
*align = format->vertalign;
*align = format->line_align;
return Ok;
}
@ -282,7 +282,7 @@ GpStatus WINGDIPAPI GdipSetStringFormatLineAlign(GpStringFormat *format,
if(!format)
return InvalidParameter;
format->vertalign = align;
format->line_align = align;
return Ok;
}