Browse Source

Prevent visibility notification been called twice in object creation

Chaosus 7 năm trước cách đây
mục cha
commit
d42b17607e
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      scene/2d/canvas_item.cpp

+ 2 - 1
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