summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro J. Estébanez <pedrojrulez@gmail.com>2018-11-16 01:01:17 +0100
committerPedro J. Estébanez <pedrojrulez@gmail.com>2018-11-16 01:01:17 +0100
commit5dac6ef486e1e35a7b644a90ce9db71b5aea13a3 (patch)
tree0d3960c30bf1fe34a8660be70916a590c4118e08
parenta16d9c6ab68cadb3cff07ef8b7b8c00717e98922 (diff)
Fix CanvasLayer trying to re-stack while out of tree
Fixes #23718.
-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;
}
}