You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: masonry/ARCHITECTURE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,7 +166,7 @@ The current passes are:
166
166
-**on_xxx_event:** Handles UX-related events, e.g. clicks, text entered, IME updates and accessibility input. Widgets can declare these events as "handled" which has a bunch of semantic implications.
167
167
-**anim:** Do updates related to an animation frame.
168
168
-**update:** Handles internal changes to some widgets, e.g. when the widget is marked as "disabled" or Masonry detects that a widget is hovered by a pointer.
169
-
-**layout:** Container widgets measure their children with `LayoutCtx::compute_size` and then lay them out with `LayoutCtx::run_layout`, finally giving them a position with `LayoutCtx::place_child`.
169
+
-**layout:** Container widgets measure their children with `LayoutCtx::compute_size` and then lay them out with `LayoutCtx::layout_child`, choosing an origin and size for each child.
170
170
-**compose:** Computes the global transform/origin for every widget.
171
171
-**paint** Paint every widget.
172
172
-**accessibility:** Compute every widget's node in the accessibility tree.
@@ -163,7 +162,8 @@ There are a few things to note here:
163
162
164
163
### `compose`
165
164
166
-
The `compose` method is called during the compose pass, after layout.
165
+
The `compose` method may be called during the compose pass, after layout.
166
+
Masonry guarantees that `compose` is called after that widget's `layout` method runs, or when the widget explicitly requests compose.
167
167
168
168
The compose pass runs top-down and assigns transforms to children. Transform-only layout changes (e.g. scrolling) should request compose instead of requesting layout.
169
169
@@ -321,11 +321,11 @@ So for instance, if `VerticalStack::children_ids()` returns a list of three chil
321
321
Pass methods in container widgets should only implement the logic that is specific to the container itself.
322
322
For instance, a container widget with a background color should implement `paint` to draw the background.
0 commit comments