diff options
Diffstat (limited to 'scene/gui/spin_box.cpp')
-rw-r--r-- | scene/gui/spin_box.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index a82e9f7009..3670f13705 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -41,10 +41,12 @@ Size2 SpinBox::get_minimum_size() const { void SpinBox::_value_changed(double) { String value = String::num(get_value(), Math::range_step_decimals(get_step())); - if (prefix != "") + if (prefix != "") { value = prefix + " " + value; - if (suffix != "") + } + if (suffix != "") { value += " " + suffix; + } line_edit->set_text(value); } @@ -159,8 +161,9 @@ void SpinBox::_gui_input(const Ref<InputEvent> &p_event) { void SpinBox::_line_edit_focus_exit() { // discontinue because the focus_exit was caused by right-click context menu - if (line_edit->get_menu()->is_visible()) + if (line_edit->get_menu()->is_visible()) { return; + } _text_entered(line_edit->get_text()); } |