From fc7038b07354002a81b47e4b8d9f2e17691c5a0b Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Thu, 24 Mar 2022 19:14:14 +0100 Subject: [PATCH] Update root order on layer change When the layer of a CanvasLayer changes, the order of roots needs to be recalculated. (cherry picked from commit 8d60e8b5d4120d9f9a4868bfb8f0059e733d6d5f) --- scene/main/canvas_layer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp index 937ef9464..c67a17ee5 100644 --- a/scene/main/canvas_layer.cpp +++ b/scene/main/canvas_layer.cpp @@ -37,6 +37,7 @@ void CanvasLayer::set_layer(int p_xform) { layer = p_xform; if (viewport.is_valid()) { RenderingServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent()); + vp->_gui_set_root_order_dirty(); } }