Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Sun, 27 May 2018 19:10:43 +0000 (21:10 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 27 May 2018 19:10:43 +0000 (21:10 +0200)
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_widgets.c

index de1c1de4bcf343aec106123a50720b5e1fd80092..a99950016598e1e84b9cd168d1d86ad4eeb14917 100644 (file)
@@ -3212,7 +3212,9 @@ static uiBut *ui_def_but(
        }
 #ifdef USE_NUMBUTS_LR_ALIGN
        else if (ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER)) {
-               but->drawflag |= UI_BUT_TEXT_LEFT;
+               if (slen != 0) {
+                       but->drawflag |= UI_BUT_TEXT_LEFT;
+               }
        }
 #endif
 
index 01150758db404d56dae64dddf4f20ba8a747cea5..e4faac5129ee948bf8f74fa90b0879b0778dd527 100644 (file)
@@ -1881,7 +1881,9 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
        }
 
 #ifdef USE_NUMBUTS_LR_ALIGN
-       if (!drawstr_right && ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER) &&
+       if (!drawstr_right &&
+           (but->drawflag & UI_BUT_TEXT_LEFT) &&
+           ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER) &&
            /* if we're editing or multi-drag (fake editing), then use left alignment */
            (but->editstr == NULL) && (drawstr == but->drawstr))
        {