[Bf-blender-cvs] [d1efd44] blender-v2.77-release: Fix assert in UI code
Campbell Barton
noreply at git.blender.org
Fri Mar 4 17:36:04 CET 2016
Commit: d1efd44c1d9fc0cb271967ef12a5a5fa85cce9d7
Author: Campbell Barton
Date: Wed Mar 2 12:53:55 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rBd1efd44c1d9fc0cb271967ef12a5a5fa85cce9d7
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