move baseline alignment to position 0
parent
b7d55972c8
commit
b43d172795
|
@ -103,9 +103,9 @@ typedef enum Wellspring_HorizontalAlignment
|
|||
|
||||
typedef enum Wellspring_VerticalAlignment
|
||||
{
|
||||
WELLSPRING_VERTICALALIGNMENT_BASELINE,
|
||||
WELLSPRING_VERTICALALIGNMENT_TOP,
|
||||
WELLSPRING_VERTICALALIGNMENT_MIDDLE,
|
||||
WELLSPRING_VERTICALALIGNMENT_BASELINE,
|
||||
WELLSPRING_VERTICALALIGNMENT_BOTTOM
|
||||
} Wellspring_VerticalAlignment;
|
||||
|
||||
|
|
|
@ -344,7 +344,11 @@ static float Wellspring_INTERNAL_GetVerticalAlignOffset(
|
|||
Wellspring_VerticalAlignment verticalAlignment,
|
||||
float scale
|
||||
) {
|
||||
if (verticalAlignment == WELLSPRING_VERTICALALIGNMENT_TOP)
|
||||
if (verticalAlignment == WELLSPRING_VERTICALALIGNMENT_BASELINE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (verticalAlignment == WELLSPRING_VERTICALALIGNMENT_TOP)
|
||||
{
|
||||
return scale * font->ascent;
|
||||
}
|
||||
|
@ -352,10 +356,6 @@ static float Wellspring_INTERNAL_GetVerticalAlignOffset(
|
|||
{
|
||||
return scale * (font->ascent + font->descent) / 2.0f;
|
||||
}
|
||||
else if (verticalAlignment == WELLSPRING_VERTICALALIGNMENT_BASELINE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else /* BOTTOM */
|
||||
{
|
||||
return scale * font->descent;
|
||||
|
|
Loading…
Reference in New Issue