diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index aa3cabaeaf3..2064d8a28b9 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -230,7 +230,8 @@ void EditorSpinSlider::_value_input_gui_input(const Ref &p_event) { set_value(last_value + real_step); } - value_input->set_text(get_text_value()); + value_input_dirty = true; + set_process_internal(true); } break; case KEY_DOWN: { _evaluate_input_text(); @@ -243,7 +244,8 @@ void EditorSpinSlider::_value_input_gui_input(const Ref &p_event) { set_value(last_value - real_step); } - value_input->set_text(get_text_value()); + value_input_dirty = true; + set_process_internal(true); } break; } } @@ -371,6 +373,14 @@ void EditorSpinSlider::_notification(int p_what) { value_input->add_style_override("normal", stylebox); } break; + case NOTIFICATION_INTERNAL_PROCESS: + if (value_input_dirty) { + value_input_dirty = false; + value_input->set_text(get_text_value()); + } + set_process_internal(false); + break; + case NOTIFICATION_DRAW: _draw_spin_slider(); break; @@ -590,6 +600,7 @@ EditorSpinSlider::EditorSpinSlider() { value_input->connect("focus_exited", this, "_value_focus_exited"); value_input->connect("gui_input", this, "_value_input_gui_input"); value_input_just_closed = false; + value_input_dirty = false; hide_slider = false; read_only = false; use_custom_label_color = false; diff --git a/editor/editor_spin_slider.h b/editor/editor_spin_slider.h index fae52ea661e..097d9f1d317 100644 --- a/editor/editor_spin_slider.h +++ b/editor/editor_spin_slider.h @@ -64,6 +64,7 @@ class EditorSpinSlider : public Range { LineEdit *value_input; bool value_input_just_closed; + bool value_input_dirty; void _grabber_gui_input(const Ref &p_event); void _value_input_closed();