mirror of https://github.com/bjornbytes/lovr.git
Fix vertical text align;
Off-by-one error with counting lines.
This commit is contained in:
parent
c473bf50e8
commit
bec98004ff
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue