Explorar o código

Document condition to avoid mistakes (like #17690)

Juan Linietsky %!s(int64=7) %!d(string=hai) anos
pai
achega
61d70fe47c
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      scene/2d/canvas_item.cpp

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

@@ -821,6 +821,12 @@ float CanvasItem::draw_char(const Ref<Font> &p_font, const Point2 &p_pos, const
 
 void CanvasItem::_notify_transform(CanvasItem *p_node) {
 
+	/* This check exists to avoid re-propagating the transform
+	 * notification down the tree on dirty nodes. It provides
+	 * optimization by avoiding redundancy (nodes are dirty, will get the
+	 * notification anyway).
+	 */
+
 	if (/*p_node->xform_change.in_list() &&*/ p_node->global_invalid) {
 		return; //nothing to do
 	}