Browse Source

Merge pull request #18172 from Chaosus/fix_notification

Prevent visibility notification from being called twice in object creation
Rémi Verschelde 7 years ago
parent
commit
3b1ea51e40
1 changed files with 2 additions and 1 deletions
  1. 2 1
      scene/2d/canvas_item.cpp

+ 2 - 1
scene/2d/canvas_item.cpp

@@ -271,7 +271,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