move baseline alignment to position 0

main
cosmonaut 2022-04-13 15:09:45 -07:00
parent b7d55972c8
commit b43d172795
2 changed files with 6 additions and 6 deletions

View File

@ -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;

View File

@ -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;