BLF: Don't Print Empty Strings

Optimize font drawing by skipping empty strings.

See D15472 for more details.

Differential Revision: https://developer.blender.org/D15472

Reviewed by Campbell Barton
This commit is contained in:
Harley Acheson
2022-07-28 17:28:05 -07:00
parent e261290cb6
commit 848dd4a40a

View File

@@ -836,7 +836,7 @@ static void blf_font_boundbox_foreach_glyph_ex(FontBLF *font,
size_t i = 0, i_curr;
rcti gbox_px;
if (str_len == 0) {
if (str_len == 0 || str[0] == 0) {
/* early output. */
return;
}