Merge pull request #69558 from timothyqiu/canvas-layer-unique-call

[3.x] Fix CanvasLayer visibility toggle can only run once per frame
This commit is contained in:
Rémi Verschelde 2022-12-11 15:39:57 +01:00 committed by GitHub
commit f128170a18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,7 +55,7 @@ void CanvasLayer::set_visible(bool p_visible) {
// For CanvasItems that is explicitly top level or has non-CanvasItem parents.
if (is_inside_tree()) {
const String group = "root_canvas" + itos(canvas.get_id());
get_tree()->call_group_flags(SceneTree::GROUP_CALL_UNIQUE, group, "_toplevel_visibility_changed", p_visible);
get_tree()->call_group(group, "_toplevel_visibility_changed", p_visible);
}
}