diff options
Diffstat (limited to 'scene/2d/canvas_item.cpp')
-rw-r--r-- | scene/2d/canvas_item.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 8f6df43c76..35b453d71d 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -389,8 +389,8 @@ Matrix32 CanvasItem::get_global_transform_with_canvas() const { if (last_valid->canvas_layer) return last_valid->canvas_layer->get_transform() * xform; - else - return xform; + else if (is_inside_tree()) + return get_viewport()->get_canvas_transform() * xform; } Matrix32 CanvasItem::get_global_transform() const { @@ -548,6 +548,7 @@ void CanvasItem::_notification(int p_what) { get_parent()->cast_to<CanvasItem>()->children_items.erase(C); C=NULL; } + global_invalid=true; } break; case NOTIFICATION_DRAW: { |