From cc91cae030091255d23ef1b31f621773527726c5 Mon Sep 17 00:00:00 2001 From: kobewi Date: Thu, 21 Mar 2024 15:03:52 +0100 Subject: [PATCH] Remove redundant grabbing code from vector editor --- editor/inspector/editor_properties_vector.cpp | 14 +------------- editor/inspector/editor_properties_vector.h | 2 -- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/editor/inspector/editor_properties_vector.cpp b/editor/inspector/editor_properties_vector.cpp index f9648193bb..351a660136 100644 --- a/editor/inspector/editor_properties_vector.cpp +++ b/editor/inspector/editor_properties_vector.cpp @@ -91,10 +91,7 @@ void EditorPropertyVectorN::update_property() { spin_sliders[i]->set_value_no_signal(val.get(i)); } } - - if (!is_grabbed) { - _update_ratio(); - } + _update_ratio(); } void EditorPropertyVectorN::_update_ratio() { @@ -119,13 +116,6 @@ void EditorPropertyVectorN::_store_link(bool p_linked) { EditorSettings::get_singleton()->set_project_metadata("linked_properties", key, p_linked); } -void EditorPropertyVectorN::_grab_changed(bool p_grab) { - if (p_grab) { - _update_ratio(); - } - is_grabbed = p_grab; -} - void EditorPropertyVectorN::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { @@ -229,8 +219,6 @@ EditorPropertyVectorN::EditorPropertyVectorN(Variant::Type p_type, bool p_force_ spin[i]->set_h_size_flags(SIZE_EXPAND_FILL); } spin[i]->connect(SceneStringName(value_changed), callable_mp(this, &EditorPropertyVectorN::_value_changed).bind(String(COMPONENT_LABELS[i]))); - spin[i]->connect(SNAME("grabbed"), callable_mp(this, &EditorPropertyVectorN::_grab_changed).bind(true)); - spin[i]->connect(SNAME("ungrabbed"), callable_mp(this, &EditorPropertyVectorN::_grab_changed).bind(false)); add_focusable(spin[i]); } diff --git a/editor/inspector/editor_properties_vector.h b/editor/inspector/editor_properties_vector.h index 265e422f8c..40c55d33f9 100644 --- a/editor/inspector/editor_properties_vector.h +++ b/editor/inspector/editor_properties_vector.h @@ -47,13 +47,11 @@ class EditorPropertyVectorN : public EditorProperty { Vector spin_sliders; TextureButton *linked = nullptr; Vector ratio; - bool is_grabbed = false; bool radians_as_degrees = false; void _update_ratio(); void _store_link(bool p_linked); - void _grab_changed(bool p_grab); void _value_changed(double p_val, const String &p_name); protected: