1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! `positionType: "fixed"` on bevy's `FixedNode`.
//!
//! Bevy lays a `FixedNode` out as its own layout root: against the viewport
//! of its UI camera, taking no space in its parent, with none of its
//! ancestors' clips, scroll offsets or transforms (`ui_layout_system`,
//! `update_clipping_system`). It stays a child for everything else — the
//! camera it targets, visibility, stack order, events, despawn.
//!
//! The style asks for it with [`PositionFixed`] (and `PositionType::Absolute`
//! in the `Node` — in bevy's implicit viewport grid a relative item's insets
//! are nudges; only an absolute one is pinned to an edge by them), and
//! [`sync_fixed_nodes`] is the one writer of the component. Every engine
//! that assumes a child lives in its parent's frame treats it as a boundary:
//! layer membership (`crate::layer`), the transformed-layer picking remap,
//! the layout transition walk (`crate::transition::layout`).
use *;
use crateReactNode;
/// The node's style asks for `positionType: "fixed"`
/// (`style::writers::POSITION_FIXED_WRITER`).
;
/// bevy's `FixedNode` on a React node: present iff the node asks for it
/// ([`PositionFixed`]) and no ancestor is `display: none`.
///
/// Bevy lays a fixed node out as its own root and discards its inherited
/// clip, so a hidden ancestor would not hide it. Without the component it is
/// a plain absolute child, and gets the zero size and the full clip every
/// hidden descendant gets.
///
/// Runs in `PostUpdate` before layout. Nothing runs while no node is fixed;
/// with one mounted, the change filters cost two tick compares per UI node
/// per frame, and the ancestors are walked only on a frame where a `Node` or
/// a parent link did change.