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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-05-27 18:15:48 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-05-27 18:25:55 +0300
commitc5a8a4e9d8bda11cd8314473b190189fd1303c98 (patch)
treecbfa3317dc6c90f57fb4fd544cbf080487ea7e0c /source/blender/editors/interface/interface_widgets.c
parentbe4d34ca863757528deb9968578045737fecf868 (diff)
Fix mismatch in strings length compute in filebrowser, leading to annoying '...' in longest filename.
We must take kerning into account everywhere! Note this will disappear in upcomming filebrowser refactor anyway. Reported through IRC by Pablo (venomgfx), thanks.
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r--source/blender/editors/interface/interface_widgets.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index deb238061dc..fb7b319b720 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -973,6 +973,10 @@ float UI_text_clip_middle_ex(
{
float strwidth;
+ /* 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 allipsis... */
+ okwidth += 1.0f + UI_DPI_FAC;
+
BLI_assert(str[0]);
/* need to set this first */