diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-02-28 05:55:27 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-02-28 05:55:27 +0400 |
commit | 2a4cd1d203050e76f8738c87400996c0e9b89e41 (patch) | |
tree | e1fb328233dc55e22de2d8e7645e2cc017fe589e /source/blender | |
parent | fa38c3dbac314aa21359f684d52d15652012961e (diff) |
Bugfix for clipping of SEARCH_MENU icon text.
For the preview-icon search menu (used for example in brush
selection), clip the text so that long names don't flow out into the
space between columns.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index cd0844a38a3..8f5c08236cf 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -3292,9 +3292,13 @@ void ui_draw_preview_item(uiFontStyle *fstyle, rcti *rect, const char *name, int BLF_width_and_height(fstyle->uifont_id, name, &font_dims[0], &font_dims[1]); + /* text rect */ trect.xmin += 0; trect.xmax = trect.xmin + font_dims[0] + 10; trect.ymin += 10; trect.ymax = trect.ymin + font_dims[1]; + if(trect.xmax > rect->xmax - PREVIEW_PAD) + trect.xmax = rect->xmax - PREVIEW_PAD; + uiStyleFontDraw(fstyle, &trect, name); } |