Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-03-18 04:07:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-03-18 04:07:10 +0400
commiteaf387b8df74c50388137e9c3b9986334478988a (patch)
tree0d6035baf753dc9fbeaa87857c3ba60337f0f60f /source/blender/editors/interface/interface_widgets.c
parentec55074f89220ba729e2b84058a3a55feb13ab34 (diff)
UI: bypass text clipping on buttons with no text
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r--source/blender/editors/interface/interface_widgets.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 9eb39f67831..68417f90f04 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -978,6 +978,8 @@ static void ui_text_clip_right_ex(uiFontStyle *fstyle, char *str, const size_t m
float tmp;
int l_end;
+ BLI_assert(str[0]);
+
/* If the trailing ellipsis takes more than 20% of all available width, just cut the string
* (as using the ellipsis would remove even more useful chars, and we cannot show much already!).
*/
@@ -1000,6 +1002,8 @@ static float ui_text_clip_middle_ex(uiFontStyle *fstyle, char *str, const float
{
float strwidth;
+ BLI_assert(str[0]);
+
/* need to set this first */
uiStyleFontSet(fstyle);
@@ -1417,6 +1421,11 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
if (but->editstr && but->pos >= 0) {
ui_text_clip_cursor(fstyle, but, rect);
}
+ else if (but->drawstr[0] == '\0') {
+ /* bypass text clipping on icon buttons */
+ but->ofs = 0;
+ but->strwidth = 0;
+ }
else if (ELEM(but->type, NUM, NUMSLI)) {
ui_text_clip_right_label(fstyle, but, rect);
}