[Bf-blender-cvs] [56a531e] master: Fix T38043: Text clipping when it shouldn't

Bastien Montagne noreply at git.blender.org
Fri Jan 3 16:06:52 CET 2014


Commit: 56a531eb29bb9ec2e4687645bd22f832054e635f
Author: Bastien Montagne
Date:   Fri Jan 3 15:47:59 2014 +0100
https://developer.blender.org/rB56a531eb29bb9ec2e4687645bd22f832054e635f

Fix T38043: Text clipping when it shouldn't

Tweak some more 'middle clipping' (zoom issues).

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

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

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

diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 6139130..3976034 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -812,7 +812,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
 
 /* *********************** text/icon ************************************** */
 
-#define UI_TEXT_CLIP_MARGIN (0.25f * U.widget_unit / but->block->aspect)
+#define UI_TEXT_CLIP_MARGIN (0.22f * U.widget_unit / but->block->aspect)
 
 #define PREVIEW_PAD 4
 
@@ -994,7 +994,7 @@ static void ui_text_clip_middle(uiFontStyle *fstyle, uiBut *but, const rcti *rec
 		const float sep_strwidth = BLF_width(fstyle->uifont_id, sep, sep_len + 1);
 		const float parts_strwidth = ((float)okwidth - sep_strwidth) / 2.0f;
 
-		if (parts_strwidth < (float)UI_DPI_ICON_SIZE) {
+		if (parts_strwidth < (float)(UI_DPI_ICON_SIZE) / but->block->aspect * 1.5) {
 			/* If we really have no place, only show start of string. */
 			l_end = BLF_width_to_strlen(fstyle->uifont_id, but->drawstr, max_len, okwidth, &strwidth);
 			but->drawstr[l_end] = '\0';
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index c0b5214..4718f5d 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -1027,7 +1027,7 @@ void buttons_context_draw(const bContext *C, uiLayout *layout)
 					uiItemLDrag(row, ptr, "", icon);  /* save some space */
 				else
 					uiItemLDrag(row, ptr, name, icon);
-								 
+
 				if (name != namebuf)
 					MEM_freeN(name);
 			}




More information about the Bf-blender-cvs mailing list