summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQbieShay <cislaghi.ilaria@gmail.com>2018-10-14 19:33:34 +0200
committerQbieShay <cislaghi.ilaria@gmail.com>2018-10-14 19:33:34 +0200
commit9de3924fea091ed9877c9edad3b3688ecfe23449 (patch)
treefb214d906a65a4de7e025669fb705126c14c2593
parentfe0db6c4797b8094c64e4ad017e29be866288628 (diff)
fixed visibility toggle with node selection
before this PR toggling visibility of not selected nodes would toggle the visibility of the whole selection. This PR changes this behaviour, so if visibility is toggled on a node that it is not selected, the visibility toggle will happen only on this node. No changes to the behaviour of when one of the selected nodes has visibility toggled: they still toggle all together
-rw-r--r--editor/scene_tree_editor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index 07670bb420..848e4def6d 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -73,7 +73,7 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i
undo_redo->create_action(TTR("Toggle Visible"));
_toggle_visible(n);
List<Node *> selection = editor_selection->get_selected_node_list();
- if (selection.size() > 1) {
+ if (selection.size() > 1 && selection.find(n) != NULL) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
Node *nv = E->get();
ERR_FAIL_COND(!nv);