From d42b17607ef14aeb72036f8747eb4d5c64979872 Mon Sep 17 00:00:00 2001 From: Chaosus Date: Fri, 13 Apr 2018 15:11:19 +0300 Subject: [PATCH] Prevent visibility notification been called twice in object creation --- scene/2d/canvas_item.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 2b890621811..8a6a86d9d1c 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -263,7 +263,8 @@ bool CanvasItem::is_visible_in_tree() const { void CanvasItem::_propagate_visibility_changed(bool p_visible) { - notification(NOTIFICATION_VISIBILITY_CHANGED); + if (!first_draw) + notification(NOTIFICATION_VISIBILITY_CHANGED); if (p_visible) update(); //todo optimize