From 848dd4a40afed8874abfb499100f09ff291ce14e Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Thu, 28 Jul 2022 17:28:05 -0700 Subject: 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 --- source/blender/blenfont/intern/blf_font.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3