diff --git a/src/display/gui/font.c b/src/display/gui/font.c index 0fa6debd..b1597c34 100644 --- a/src/display/gui/font.c +++ b/src/display/gui/font.c @@ -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; } \ No newline at end of file