Fix T38043: Text clipping when it shouldn't

Tweak some more 'middle clipping' (zoom issues).
This commit is contained in:
2014-01-03 15:47:59 +01:00
parent ba8d65a9a7
commit 56a531eb29
2 changed files with 3 additions and 3 deletions

View File

@@ -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';

View File

@@ -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);
}