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:
parent
69b41e7cf3
commit
c89de1dd08
|
@ -450,7 +450,7 @@ struct GpStringFormat{
|
||||||
StringAlignment align;
|
StringAlignment align;
|
||||||
StringTrimming trimming;
|
StringTrimming trimming;
|
||||||
HotkeyPrefix hkprefix;
|
HotkeyPrefix hkprefix;
|
||||||
StringAlignment vertalign;
|
StringAlignment line_align;
|
||||||
StringDigitSubstitute digitsub;
|
StringDigitSubstitute digitsub;
|
||||||
INT tabcount;
|
INT tabcount;
|
||||||
REAL firsttab;
|
REAL firsttab;
|
||||||
|
|
|
@ -5417,19 +5417,19 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
|
||||||
|
|
||||||
/* Should be no need to explicitly test for StringAlignmentNear as
|
/* Should be no need to explicitly test for StringAlignmentNear as
|
||||||
* that is default behavior if no alignment is passed. */
|
* that is default behavior if no alignment is passed. */
|
||||||
if(format->vertalign != StringAlignmentNear){
|
if(format->line_align != StringAlignmentNear){
|
||||||
RectF bounds, in_rect = *rect;
|
RectF bounds, in_rect = *rect;
|
||||||
in_rect.Height = 0.0; /* avoid height clipping */
|
in_rect.Height = 0.0; /* avoid height clipping */
|
||||||
GdipMeasureString(graphics, string, length, font, &in_rect, format, &bounds, 0, 0);
|
GdipMeasureString(graphics, string, length, font, &in_rect, format, &bounds, 0, 0);
|
||||||
|
|
||||||
TRACE("bounds %s\n", debugstr_rectf(&bounds));
|
TRACE("bounds %s\n", debugstr_rectf(&bounds));
|
||||||
|
|
||||||
if(format->vertalign == StringAlignmentCenter)
|
if(format->line_align == StringAlignmentCenter)
|
||||||
offsety = (rect->Height - bounds.Height) / 2;
|
offsety = (rect->Height - bounds.Height) / 2;
|
||||||
else if(format->vertalign == StringAlignmentFar)
|
else if(format->line_align == StringAlignmentFar)
|
||||||
offsety = (rect->Height - bounds.Height);
|
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);
|
save_state = SaveDC(hdc);
|
||||||
|
|
|
@ -1028,13 +1028,13 @@ GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT
|
||||||
heap_free(backup);
|
heap_free(backup);
|
||||||
return status;
|
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;
|
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->line_align == StringAlignmentFar) {
|
||||||
float inc = layoutRect->Height + layoutRect->Y - args.maxY;
|
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;
|
||||||
|
|
|
@ -178,7 +178,7 @@ GpStatus WINGDIPAPI GdipGetStringFormatLineAlign(GpStringFormat *format,
|
||||||
if(!format || !align)
|
if(!format || !align)
|
||||||
return InvalidParameter;
|
return InvalidParameter;
|
||||||
|
|
||||||
*align = format->vertalign;
|
*align = format->line_align;
|
||||||
|
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,7 @@ GpStatus WINGDIPAPI GdipSetStringFormatLineAlign(GpStringFormat *format,
|
||||||
if(!format)
|
if(!format)
|
||||||
return InvalidParameter;
|
return InvalidParameter;
|
||||||
|
|
||||||
format->vertalign = align;
|
format->line_align = align;
|
||||||
|
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue