diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-01-03 18:47:59 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-01-03 18:49:07 +0400 |
commit | 56a531eb29bb9ec2e4687645bd22f832054e635f (patch) | |
tree | de622503a026744df242b69e8fec915e910dfd6c /source/blender/editors | |
parent | ba8d65a9a7a0fbcf49dbfcd15625a75062f6d302 (diff) |
Fix T38043: Text clipping when it shouldn't
Tweak some more 'middle clipping' (zoom issues).
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 6139130d899..3976034e348 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -812,7 +812,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol) /* *********************** text/icon ************************************** */ -#define UI_TEXT_CLIP_MARGIN (0.25f * U.widget_unit / but->block->aspect) +#define UI_TEXT_CLIP_MARGIN (0.22f * U.widget_unit / but->block->aspect) #define PREVIEW_PAD 4 @@ -994,7 +994,7 @@ static void ui_text_clip_middle(uiFontStyle *fstyle, uiBut *but, const rcti *rec const float sep_strwidth = BLF_width(fstyle->uifont_id, sep, sep_len + 1); const float parts_strwidth = ((float)okwidth - sep_strwidth) / 2.0f; - if (parts_strwidth < (float)UI_DPI_ICON_SIZE) { + if (parts_strwidth < (float)(UI_DPI_ICON_SIZE) / but->block->aspect * 1.5) { /* If we really have no place, only show start of string. */ l_end = BLF_width_to_strlen(fstyle->uifont_id, but->drawstr, max_len, okwidth, &strwidth); but->drawstr[l_end] = '\0'; diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index c0b5214f920..4718f5dbbdd 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -1027,7 +1027,7 @@ void buttons_context_draw(const bContext *C, uiLayout *layout) uiItemLDrag(row, ptr, "", icon); /* save some space */ else uiItemLDrag(row, ptr, name, icon); - + if (name != namebuf) MEM_freeN(name); } |