Explorar o código

Prevent visibility notification been called twice in object creation

Chaosus %!s(int64=7) %!d(string=hai) anos
pai
achega
d42b17607e
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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