void CanvasItem::_propagate_visibility_changed(bool p_visible) { notification(NOTIFICATION_VISIBILITY_CHANGED); if (p_visible) update(); //todo optimize else emit_signal(SceneStringNames::get_singleton()->hide); _block(); for (int i = 0; i < get_child_count(); i++) { CanvasItem *c = Object::cast_to<CanvasItem>(get_child(i)); if (c && c->visible) //should the toplevels stop propagation? i think so but.. c->_propagate_visibility_changed(p_visible); } _unblock(); }