From 17388794ce0d31344944842b1f76d23921687cc4 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 18 May 2015 13:02:05 +0200 Subject: Filebrowser: Do not intent to draw empty strings, loss of time. Fixes assert raised in `UI_text_clip_middle_ex()` when trying to draw (empty) 'size' string for appended/linked blender datablocks. --- source/blender/editors/space_file/file_draw.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_file/file_draw.c') diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 3553a0ed79a..2bd92b1e207 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -295,11 +295,18 @@ static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon, static void file_draw_string(int sx, int sy, const char *string, float width, int height, short align) { - uiStyle *style = UI_style_get(); - uiFontStyle fs = style->widgetlabel; + uiStyle *style; + uiFontStyle fs; rcti rect; char fname[FILE_MAXFILE]; + if (string[0] == '\0') { + return; + } + + style = UI_style_get(); + fs = style->widgetlabel; + fs.align = align; BLI_strncpy(fname, string, FILE_MAXFILE); -- cgit v1.2.3