Fix vertical text align;

Off-by-one error with counting lines.
This commit is contained in:
bjorn 2019-01-24 14:07:02 -08:00
parent c473bf50e8
commit bec98004ff
1 changed files with 1 additions and 1 deletions

View File

@ -1015,7 +1015,7 @@ void lovrGraphicsPrint(const char* str, size_t length, mat4 transform, float wra
lovrFontMeasure(font, str, length, wrap, &width, &lineCount, &glyphCount);
float scale = 1.f / font->pixelDensity;
float offsetY = (lineCount * font->rasterizer->height * font->lineHeight) * (valign / 2.f);
float offsetY = ((lineCount + 1) * font->rasterizer->height * font->lineHeight) * (valign / 2.f);
mat4_scale(transform, scale, scale, scale);
mat4_translate(transform, 0.f, offsetY, 0.f);