Skip to content

Commit

Permalink
Fix visibility toggle for Spatials in SceneTreeEditor
Browse files Browse the repository at this point in the history
Fixes #17722, was a regression from #15239.
  • Loading branch information
akien-mga committed Mar 24, 2018
1 parent 60835ce commit 3764cf6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions editor/scene_tree_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,13 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i

void SceneTreeEditor::_toggle_visible(Node *p_node) {
if (p_node->is_type("Spatial")) {
bool v = bool(p_node->call("is_visible"));
p_node->call("set_visible", !v);
}
else if (p_node->is_type("CanvasItem")) {
bool v = !bool(p_node->call("is_hidden"));
p_node->call("_set_visible_", !v);
} else if (p_node->is_type("CanvasItem")) {
bool v = bool(p_node->call("is_visible"));
if (v) {
p_node->call("hide");
}
else {
} else {
p_node->call("show");
}
}
Expand Down

0 comments on commit 3764cf6

Please sign in to comment.