[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44496] trunk/blender/source/blender/ editors/interface/interface_widgets.c: Bugfix for clipping of SEARCH_MENU icon text.

Nicholas Bishop nicholasbishop at gmail.com
Tue Feb 28 02:55:32 CET 2012


Revision: 44496
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44496
Author:   nicholasbishop
Date:     2012-02-28 01:55:27 +0000 (Tue, 28 Feb 2012)
Log Message:
-----------
Bugfix for clipping of SEARCH_MENU icon text.

For the preview-icon search menu (used for example in brush
selection), clip the text so that long names don't flow out into the
space between columns.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_widgets.c

Modified: trunk/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_widgets.c	2012-02-27 21:33:30 UTC (rev 44495)
+++ trunk/blender/source/blender/editors/interface/interface_widgets.c	2012-02-28 01:55:27 UTC (rev 44496)
@@ -3292,9 +3292,13 @@
 
 	BLF_width_and_height(fstyle->uifont_id, name, &font_dims[0], &font_dims[1]);
 
+	/* text rect */
 	trect.xmin += 0;
 	trect.xmax = trect.xmin + font_dims[0] + 10;
 	trect.ymin += 10;
 	trect.ymax = trect.ymin + font_dims[1];
+	if(trect.xmax > rect->xmax - PREVIEW_PAD)
+		trect.xmax = rect->xmax - PREVIEW_PAD;
+
 	uiStyleFontDraw(fstyle, &trect, name);
 }




More information about the Bf-blender-cvs mailing list