Fix visibility toggle for Spatials in SceneTreeEditor

Fixes #17722, was a regression from #15239.
This commit is contained in:
Rémi Verschelde 2018-03-24 16:54:05 +01:00
parent 60835ce88e
commit 3764cf6245
1 changed files with 4 additions and 6 deletions

View File

@ -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");
}
}