Fix T38043: Text clipping when it shouldn't
authorBastien Montagne <montagne29@wanadoo.fr>
Fri, 3 Jan 2014 14:47:59 +0000 (15:47 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Fri, 3 Jan 2014 14:49:07 +0000 (15:49 +0100)
Tweak some more 'middle clipping' (zoom issues).

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

index 6139130d899136e370fbda0e9ca4394d5552cb7d..3976034e34858645623aac13914f095cbf8eb9e2 100644 (file)
@@ -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';
index c0b5214f920491d30a12f49a732f62496ae4dbfb..4718f5dbbdde577aa2cc737234d88412d57aa09d 100644 (file)
@@ -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);
                        }