[Bf-blender-cvs] [f5234474bde] master: Fix T97618: Clipped text labels intermittently missing ellipses

Colin Basnett noreply at git.blender.org
Thu Aug 18 03:43:35 CEST 2022


Commit: f5234474bde953356c72633bd05a1c6c9f747758
Author: Colin Basnett
Date:   Thu Aug 18 10:15:27 2022 +1000
Branches: master
https://developer.blender.org/rBf5234474bde953356c72633bd05a1c6c9f747758

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

===================================================================

M	source/blender/editors/interface/interface_widgets.c

===================================================================

diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 855e72788d2..94e9e98c685 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -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;
 }



More information about the Bf-blender-cvs mailing list