fix vertical alignment
continuous-integration/drone/push Build is passing Details

pull/1/head
cosmonaut 2023-12-15 10:04:22 -08:00
parent 1cba7f3faa
commit 6266adb393
1 changed files with 2 additions and 2 deletions

View File

@ -615,7 +615,7 @@ static uint8_t Wellspring_Internal_TextBounds(
float advance = 0; float advance = 0;
float sizeFactor = pixelSize / font->pixelsPerEm; 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) for (i = 0; i < strLengthInBytes; i += 1)
{ {
@ -755,7 +755,7 @@ uint8_t Wellspring_AddToTextBatch(
float sizeFactor = pixelSize / font->pixelsPerEm; float sizeFactor = pixelSize / font->pixelsPerEm;
float x = 0, y = 0; 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. */ /* FIXME: If we horizontally align, we have to decode and process glyphs twice, very inefficient. */
if (horizontalAlignment == WELLSPRING_HORIZONTALALIGNMENT_RIGHT) if (horizontalAlignment == WELLSPRING_HORIZONTALALIGNMENT_RIGHT)