mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-03-28 14:56:21 +01:00
Backported from godot4: Defer EditorInspector::update_tree to the process stage to improve performance
`EditorInspector::update_tree` is expensive, so defer the call to the process phase
to prevent multiple calls in a single frame (when switching scene tabs).
- Rindbee
f352c30ad5
This commit is contained in:
parent
a44fb35ca1
commit
b757336215
@ -2249,7 +2249,7 @@ void EditorInspector::_parse_added_editors(VBoxContainer *current_vbox, Ref<Edit
|
||||
ped->added_editors.clear();
|
||||
}
|
||||
|
||||
void EditorInspector::update_tree() {
|
||||
void EditorInspector::_update_tree() {
|
||||
//to update properly if all is refreshed
|
||||
StringName current_selected = property_selected;
|
||||
int current_focusable = -1;
|
||||
@ -2786,6 +2786,11 @@ void EditorInspector::update_tree() {
|
||||
_parse_added_editors(main_vbox, ped);
|
||||
}
|
||||
}
|
||||
|
||||
void EditorInspector::update_tree() {
|
||||
update_tree_pending = true;
|
||||
}
|
||||
|
||||
void EditorInspector::update_property(const String &p_prop) {
|
||||
if (!editor_property_map.has(p_prop)) {
|
||||
return;
|
||||
@ -3261,10 +3266,11 @@ 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.front()->get();
|
||||
|
@ -505,6 +505,8 @@ class EditorInspector : public ScrollContainer {
|
||||
|
||||
void _update_inspector_bg();
|
||||
|
||||
void _update_tree();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
void _notification(int p_what);
|
||||
|
Loading…
Reference in New Issue
Block a user