summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-04-07 19:12:42 +0200
committerGitHub <noreply@github.com>2017-04-07 19:12:42 +0200
commit12b84eb9f488d28f3b787fd745fd3dcfa254cab6 (patch)
tree4811ba189cbe9e6baf9794ea5066ee400c918d5e /scene
parentd8f011828e9282f6f931c5fe838399c062e7fa2d (diff)
parent4b85ddabdaf8314238cfecb1fa74ccb08f5d67d3 (diff)
Merge pull request #8304 from RandomShaper/reset-folded-on-reset-edit-children
Reset display folded for an instanced scene if editable children is toggled off
Diffstat (limited to 'scene')
-rwxr-xr-xscene/main/node.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 42e9cec217..6db4eb5640 100755
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -2063,10 +2063,14 @@ void Node::set_editable_instance(Node *p_node, bool p_editable) {
ERR_FAIL_NULL(p_node);
ERR_FAIL_COND(!is_a_parent_of(p_node));
NodePath p = get_path_to(p_node);
- if (!p_editable)
+ if (!p_editable) {
data.editable_instances.erase(p);
- else
+ // Avoid this flag being needlessly saved;
+ // also give more visual feedback if editable children is reenabled
+ set_display_folded(false);
+ } else {
data.editable_instances[p] = true;
+ }
}
bool Node::is_editable_instance(Node *p_node) const {