From 6266adb393952b64e0780ee46feb0fbeec04e0fc Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Fri, 15 Dec 2023 10:04:22 -0800 Subject: [PATCH] fix vertical alignment --- src/Wellspring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Wellspring.c b/src/Wellspring.c index 2cb1f92..445a94a 100644 --- a/src/Wellspring.c +++ b/src/Wellspring.c @@ -615,7 +615,7 @@ static uint8_t Wellspring_Internal_TextBounds( float advance = 0; float sizeFactor = pixelSize / font->pixelsPerEm; - y += Wellspring_INTERNAL_GetVerticalAlignOffset(font, verticalAlignment, sizeFactor * font->scale); + y -= Wellspring_INTERNAL_GetVerticalAlignOffset(font, verticalAlignment, sizeFactor * font->scale); for (i = 0; i < strLengthInBytes; i += 1) { @@ -755,7 +755,7 @@ uint8_t Wellspring_AddToTextBatch( float sizeFactor = pixelSize / font->pixelsPerEm; float x = 0, y = 0; - y += Wellspring_INTERNAL_GetVerticalAlignOffset(font, verticalAlignment, sizeFactor * font->scale); + y -= Wellspring_INTERNAL_GetVerticalAlignOffset(font, verticalAlignment, sizeFactor * font->scale); /* FIXME: If we horizontally align, we have to decode and process glyphs twice, very inefficient. */ if (horizontalAlignment == WELLSPRING_HORIZONTALALIGNMENT_RIGHT)