diff --git a/include/Wellspring.h b/include/Wellspring.h index 2c33c6e..21a7a63 100644 --- a/include/Wellspring.h +++ b/include/Wellspring.h @@ -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; diff --git a/src/Wellspring.c b/src/Wellspring.c index d7032f1..2719eca 100644 --- a/src/Wellspring.c +++ b/src/Wellspring.c @@ -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;