diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-11-16 15:15:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-16 15:15:48 +0100 |
commit | 193324f3541089fd95917ad341447390d7a6d14b (patch) | |
tree | e7524f2b6965a4dcd00b2b7529181a2dc84ff2cd | |
parent | 2d7fe9b298869e46dff1526e1bcbc0bb145c340e (diff) | |
parent | 5dac6ef486e1e35a7b644a90ce9db71b5aea13a3 (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.cpp | 4 |
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; } } |