[Bf-blender-cvs] [aefb68c] master: Fix assert in UI code

Campbell Barton noreply at git.blender.org
Wed Mar 2 03:04:07 CET 2016


Commit: aefb68c84d574359a20f61868b84b320b4aa0496
Author: Campbell Barton
Date:   Wed Mar 2 12:53:55 2016 +1100
Branches: master
https://developer.blender.org/rBaefb68c84d574359a20f61868b84b320b4aa0496

Fix assert in UI code

Dont attempt to clip empty string

===================================================================

M	source/blender/editors/interface/interface_widgets.c

===================================================================

diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index f803622..5898f3b 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -4087,7 +4087,9 @@ void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, const char *name, int ic
 		const float minwidth = (float)(UI_DPI_ICON_SIZE);
 
 		BLI_strncpy(drawstr, name, sizeof(drawstr));
-		UI_text_clip_middle_ex(fstyle, drawstr, okwidth, minwidth, max_len, '\0');
+		if (drawstr[0]) {
+			UI_text_clip_middle_ex(fstyle, drawstr, okwidth, minwidth, max_len, '\0');
+		}
 
 		glColor4ubv((unsigned char *)wt->wcol.text);
 		UI_fontstyle_draw(fstyle, rect, drawstr);




More information about the Bf-blender-cvs mailing list