소스 검색

Merge pull request #75238 from kleonc/canvas-item-fix-notifications-order-on-enter-tree

`CanvasItem` Fix `ENTER_CANVAS` / `VISIBILITY_CHANGED` notifications order when entering tree
Yuri Sizov 2 년 전
부모
커밋
c95b88cbe9
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      scene/main/canvas_item.cpp

+ 2 - 1
scene/main/canvas_item.cpp

@@ -289,11 +289,12 @@ void CanvasItem::_notification(int p_what) {
 				}
 			}
 
+			_enter_canvas();
+
 			RenderingServer::get_singleton()->canvas_item_set_visible(canvas_item, is_visible_in_tree()); // The visibility of the parent may change.
 			if (is_visible_in_tree()) {
 				notification(NOTIFICATION_VISIBILITY_CHANGED); // Considered invisible until entered.
 			}
-			_enter_canvas();
 
 			_update_texture_filter_changed(false);
 			_update_texture_repeat_changed(false);