diff options
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 5f74dd7a8bb..ffebd39b693 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2787,12 +2787,7 @@ void UI_block_emboss_set(uiBlock *block, char dt) block->dt = dt; } -/** - * \param but: Button to update. - * \param validate: When set, this function may change the button value. - * Otherwise treat the button value as read-only. - */ -void ui_but_update_ex(uiBut *but, const bool validate) +void ui_but_update(uiBut *but) { /* if something changed in the button */ double value = UI_BUT_VALUE_UNSET; @@ -2814,19 +2809,13 @@ void ui_but_update_ex(uiBut *but, const bool validate) case UI_BTYPE_NUM: case UI_BTYPE_SCROLL: case UI_BTYPE_NUM_SLIDER: - if (validate) { - UI_GET_BUT_VALUE_INIT(but, value); - if (value < (double)but->hardmin) { - ui_but_value_set(but, but->hardmin); - } - else if (value > (double)but->hardmax) { - ui_but_value_set(but, but->hardmax); - } + UI_GET_BUT_VALUE_INIT(but, value); + if (value < (double)but->hardmin) ui_but_value_set(but, but->hardmin); + else if (value > (double)but->hardmax) ui_but_value_set(but, but->hardmax); - /* max must never be smaller than min! Both being equal is allowed though */ - BLI_assert(but->softmin <= but->softmax && - but->hardmin <= but->hardmax); - } + /* max must never be smaller than min! Both being equal is allowed though */ + BLI_assert(but->softmin <= but->softmax && + but->hardmin <= but->hardmax); break; case UI_BTYPE_ICON_TOGGLE: @@ -3000,15 +2989,6 @@ void ui_but_update_ex(uiBut *but, const bool validate) /* text clipping moved to widget drawing code itself */ } -void ui_but_update(uiBut *but) -{ - ui_but_update_ex(but, false); -} - -void ui_but_update_edited(uiBut *but) -{ - ui_but_update_ex(but, true); -} void UI_block_align_begin(uiBlock *block) { |