浏览代码

Avoid duplicate visility changed notification, fixes #18160

Juan Linietsky 6 年之前
父节点
当前提交
0afdc5c559
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      scene/2d/canvas_item.cpp

+ 3 - 0
scene/2d/canvas_item.cpp

@@ -376,6 +376,9 @@ bool CanvasItem::is_visible_in_tree() const {
 
 void CanvasItem::_propagate_visibility_changed(bool p_visible) {
 
+	if (p_visible && first_draw) { //avoid propagating it twice
+		first_draw = false;
+	}
 	notification(NOTIFICATION_VISIBILITY_CHANGED);
 
 	if (p_visible)