summaryrefslogtreecommitdiff
path: root/scene/main/canvas_item.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main/canvas_item.cpp')
-rw-r--r--scene/main/canvas_item.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp
index 59d933fa1d..a62bbb146c 100644
--- a/scene/main/canvas_item.cpp
+++ b/scene/main/canvas_item.cpp
@@ -72,6 +72,15 @@ bool CanvasItem::is_visible_in_tree() const {
p = p->get_parent_item();
}
+ const Node *n = get_parent();
+ while (n) {
+ const CanvasLayer *c = Object::cast_to<CanvasLayer>(n);
+ if (c && !c->is_visible()) {
+ return false;
+ }
+ n = n->get_parent();
+ }
+
return true;
}
@@ -1017,8 +1026,8 @@ void CanvasItem::set_notify_transform(bool p_enable) {
notify_transform = p_enable;
if (notify_transform && is_inside_tree()) {
- //this ensures that invalid globals get resolved, so notifications can be received
- get_global_transform();
+ // This ensures that invalid globals get resolved, so notifications can be received.
+ _ALLOW_DISCARD_ get_global_transform();
}
}