diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-17 12:23:01 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-17 12:23:01 +0100 |
commit | d5dc70a47871701fc61804b0b75362f5dcdf0055 (patch) | |
tree | 292cad2dac88e8521731598d6c28d2a0b927d3bf | |
parent | ccbefa1f4316c46eed35912e954fdf0e8c88c01a (diff) | |
parent | f352c30ad59dc50d13bb979a63271b668fc39c5b (diff) | |
download | redot-engine-d5dc70a47871701fc61804b0b75362f5dcdf0055.tar.gz |
Merge pull request #68498 from Rindbee/improve-update_tree
Defer `EditorInspector::update_tree` to the process stage to improve performance
-rw-r--r-- | editor/editor_inspector.cpp | 9 | ||||
-rw-r--r-- | editor/editor_inspector.h | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index a5397a8e6a..2df14aef6c 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -2597,7 +2597,7 @@ bool EditorInspector::_is_property_disabled_by_feature_profile(const StringName return false; } -void EditorInspector::update_tree() { +void EditorInspector::_update_tree() { //to update properly if all is refreshed StringName current_selected = property_selected; int current_focusable = -1; @@ -3316,6 +3316,10 @@ void EditorInspector::update_tree() { } } +void EditorInspector::update_tree() { + update_tree_pending = true; +} + void EditorInspector::update_property(const String &p_prop) { if (!editor_property_map.has(p_prop)) { return; @@ -3910,10 +3914,9 @@ void EditorInspector::_notification(int p_what) { changing++; if (update_tree_pending) { - update_tree(); update_tree_pending = false; pending.clear(); - + _update_tree(); } else { while (pending.size()) { StringName prop = *pending.begin(); diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index 41651494ce..56d0a55319 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -540,6 +540,8 @@ class EditorInspector : public ScrollContainer { void _show_add_meta_dialog(); void _check_meta_name(const String &p_name); + void _update_tree(); + protected: static void _bind_methods(); void _notification(int p_what); |