mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix assert in UI code
Dont attempt to clip empty string
This commit is contained in:
parent
198700a36d
commit
d1efd44c1d
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue