Ver código fonte

CanvasItem Fix ENTER_CANVAS / VISIBILITY_CHANGED notifications order when entering tree

(cherry picked from commit 6e3820fd4dfb93f9be98fa86f989d123024ed216)
kleonc 2 anos atrás
pai
commit
b3f121d108
1 arquivos alterados com 2 adições e 1 exclusões
  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);