From b3f121d108b02a3577c283c02c4d12eb97f331ba Mon Sep 17 00:00:00 2001 From: kleonc <9283098+kleonc@users.noreply.github.com> Date: Wed, 22 Mar 2023 20:01:18 +0100 Subject: CanvasItem Fix ENTER_CANVAS / VISIBILITY_CHANGED notifications order when entering tree (cherry picked from commit 6e3820fd4dfb93f9be98fa86f989d123024ed216) --- scene/main/canvas_item.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scene') diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index b36353158b..72fb838732 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -289,11 +289,12 @@ void CanvasItem::_notification(int p_what) { } } + _enter_canvas(); + RenderingServer::get_singleton()->canvas_item_set_visible(canvas_item, is_visible_in_tree()); // The visibility of the parent may change. if (is_visible_in_tree()) { notification(NOTIFICATION_VISIBILITY_CHANGED); // Considered invisible until entered. } - _enter_canvas(); _update_texture_filter_changed(false); _update_texture_repeat_changed(false); -- cgit v1.2.3