restored width/height calc

This commit is contained in:
2021-05-25 20:17:40 -07:00
parent 96eec68b90
commit 2e8e2d1f75

View File

@ -110,6 +110,9 @@ fonttextinfo_t * fontTextClamp(font_t *font, char *text, float maxWidth) {
if(c == FONT_SPACE) {
x += FONT_SPACE_SIZE;
info->width = mathMax(info->width, quad->x1);
info->height = mathMax(info->height, quad->y1);
// Did this space cause a newline?
if(x > maxWidth) {
info->lines++;
@ -163,6 +166,9 @@ fonttextinfo_t * fontTextClamp(font_t *font, char *text, float maxWidth) {
info->realLength++;
}
info->width = mathMax(info->width, quad->x1);
info->height = mathMax(info->height, quad->y1);
return info;
}