summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-11-16 15:15:48 +0100
committerGitHub <noreply@github.com>2018-11-16 15:15:48 +0100
commit193324f3541089fd95917ad341447390d7a6d14b (patch)
treee7524f2b6965a4dcd00b2b7529181a2dc84ff2cd
parent2d7fe9b298869e46dff1526e1bcbc0bb145c340e (diff)
parent5dac6ef486e1e35a7b644a90ce9db71b5aea13a3 (diff)
Merge pull request #23734 from RandomShaper/fix-canvas-layer-out-of-tree
Fix CanvasLayer trying to re-stack while out of tree
-rw-r--r--scene/main/canvas_layer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp
index 93f51a44f4..89bc8c1226 100644
--- a/scene/main/canvas_layer.cpp
+++ b/scene/main/canvas_layer.cpp
@@ -164,7 +164,9 @@ void CanvasLayer::_notification(int p_what) {
} break;
case NOTIFICATION_MOVED_IN_PARENT: {
- VisualServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
+ if (is_inside_tree())
+ VisualServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
+
} break;
}
}