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:
authorTon Roosendaal <ton@blender.org>2010-12-15 18:56:06 +0300
committerTon Roosendaal <ton@blender.org>2010-12-15 18:56:06 +0300
commit9129750787aedc51f80108ee4f6c1a0dbcf5a45d (patch)
tree9d42146e432cbe970f15864dd65ee17c48bcd3db /source/blender/editors/space_file
parent95f205ed5c81b3afcb678dd48253d69e88a19f1c (diff)
Bugfix #25231
File Window: text clipping was tiny bit too narrow. It was also clipping text twice even ;)
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r--source/blender/editors/space_file/file_draw.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index c5b8969e189..ece227494c6 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -26,6 +26,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <math.h>
#include <string.h>
#include "BLI_blenlib.h"
@@ -292,20 +293,18 @@ static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon,
static void file_draw_string(int sx, int sy, const char* string, float width, int height, short align)
{
- char fname[FILE_MAXFILE];
- rcti rect;
- float sw;
uiStyle *style= U.uistyles.first;
uiFontStyle fs = style->widgetlabel;
+ rcti rect;
+ char fname[FILE_MAXFILE];
fs.align = align;
BLI_strncpy(fname,string, FILE_MAXFILE);
- sw = file_shorten_string(fname, width+1, 0 );
-
-
+
+ /* no text clipping needed, uiStyleFontDraw does it but is a bit too strict (for buttons it works) */
rect.xmin = sx;
- rect.xmax = sx + width;
+ rect.xmax = sx + ceil(width+4.0f);
rect.ymin = sy - height;
rect.ymax = sy;