[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33686] trunk/blender/source/blender/ editors/space_file/file_draw.c: Bugfix #25231

Alex K kuzsasha at gmail.com
Wed Dec 15 23:23:21 CET 2010


 file_shorten_string(fname, width+1, 0 );
^shouldn't be removed because it is used in thumbnails mode to display large
names
http://www.pasteall.org/pic/show.php?id=7526

Small consequence is center alignment is of by 4/2=2 pixels due to  +4.0f
Maybe we should check for align?
or
textwidth =( FILE_IMGDISPLAY == params->display) ? layout->tile_w :
layout->column_widths[COLUMN_NAME] + 4;

Alex



2010/12/15 Ton Roosendaal <ton at blender.org>

> Revision: 33686
>
> http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33686
> Author:   ton
> Date:     2010-12-15 16:56:06 +0100 (Wed, 15 Dec 2010)
>
> Log Message:
> -----------
> Bugfix #25231
>
> File Window: text clipping was tiny bit too narrow. It was also
> clipping text twice even ;)
>
> Modified Paths:
> --------------
>    trunk/blender/source/blender/editors/space_file/file_draw.c
>
> Modified: trunk/blender/source/blender/editors/space_file/file_draw.c
> ===================================================================
> --- trunk/blender/source/blender/editors/space_file/file_draw.c 2010-12-15
> 15:28:03 UTC (rev 33685)
> +++ trunk/blender/source/blender/editors/space_file/file_draw.c 2010-12-15
> 15:56:06 UTC (rev 33686)
> @@ -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_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;
>
>
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>



-- 
Homer: Now, good night, son.
Bart:     Uh, Dad?
Homer: What.
Bart:     What is the mind?
            Is it just a system of impulses?
            Or is it something tangible?
Homer: Relax.  What is mind?  No matter.  What is matter?  Never mind!
Bart:     Thanks, Dad.
Homer: Good night, son.
             -Good Night (The Simpsons short)


More information about the Bf-committers mailing list