[Bf-blender-cvs] [848dd4a40af] master: BLF: Don't Print Empty Strings
Harley Acheson
noreply at git.blender.org
Fri Jul 29 02:29:46 CEST 2022
Commit: 848dd4a40afed8874abfb499100f09ff291ce14e
Author: Harley Acheson
Date: Thu Jul 28 17:28:05 2022 -0700
Branches: master
https://developer.blender.org/rB848dd4a40afed8874abfb499100f09ff291ce14e
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
===================================================================
M source/blender/blenfont/intern/blf_font.c
===================================================================
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;
}
More information about the Bf-blender-cvs
mailing list