Fix T97618: Clipped text labels intermittently missing ellipses

The offending line was attempting to artificially add width to the
length of the string in order to "avoid ellipsing text that nearly
fits". The line doesn't actually appear to do anything beneficial, and
it causes the nasty text bug.

Old:
{F13029695}

New:
{F13327308}

Reviewed By: campbellbarton

Ref D15585
This commit is contained in:
Colin Basnett 2022-08-18 10:15:27 +10:00 committed by Campbell Barton
parent 2a2ca3292a
commit f5234474bd
Notes: blender-bot 2023-02-14 06:57:56 +01:00
Referenced by issue #97618, Clipped text labels are frequently and intermittently missing ellipses
1 changed files with 1 additions and 6 deletions

View File

@ -1524,11 +1524,6 @@ float UI_text_clip_middle_ex(const uiFontStyle *fstyle,
const size_t max_len,
const char rpart_sep)
{
/* Add some epsilon to OK width, avoids 'ellipsing' text that nearly fits!
* Better to have a small piece of the last char cut out,
* than two remaining chars replaced by an ellipsis... */
okwidth += 1.0f + UI_DPI_FAC;
BLI_assert(str[0]);
/* need to set this first */
@ -1627,7 +1622,7 @@ float UI_text_clip_middle_ex(const uiFontStyle *fstyle,
strwidth = BLF_width(fstyle->uifont_id, str, max_len);
}
BLI_assert(strwidth <= okwidth);
BLI_assert((strwidth <= okwidth) || (okwidth <= 0.0f));
return strwidth;
}