diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2022-07-29 03:28:05 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2022-07-29 03:28:05 +0300 |
commit | 848dd4a40afed8874abfb499100f09ff291ce14e (patch) | |
tree | dcf3978527439c9b7ab368c9ad9fa4ebb225cd3a /source/blender/blenfont | |
parent | e261290cb61696548ced2b8fe667ca2e4a67d6ee (diff) |
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
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r-- | source/blender/blenfont/intern/blf_font.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 038e73cc928..0efd3537a32 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -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; } |