pub struct Run {
pub space: Space,
pub raw: Vec2,
pub at: Vec2,
pub origin: Vec2,
pub row: bool,
pub start: f64,
pub across: f64,
pub gap: f64,
pub line: f64,
pub cut: Option<Rect>,
/* private fields */
}Expand description
A run’s children placed along it, and what they paint.
Fields§
§space: SpaceThe space its own node is in.
raw: Vec2Its node’s unrounded top-left and its rounded one, in its space.
at: Vec2§origin: Vec2Where its space’s origin was in the design’s coordinates when it was last placed: its children are placed in single precision there, as taffy places them, so they round where a whole tree’s do.
row: boolWhether its children go along x; else along y.
start: f64Where its first child starts along the run, from its node’s unrounded
top-left: the padding and any justify offset.
across: f64Where its children’s line starts across, from the same: the padding.
gap: f64The gap between children.
line: f64The breadth of its children’s line.
cut: Option<Rect>What cuts it in its space: its clipping frames’ boxes.
Implementations§
Source§impl Run
impl Run
pub fn new(space: Space) -> Run
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn place(&self, before: f64, across: f64) -> (Vec2, Vec2)
pub fn place(&self, before: f64, across: f64) -> (Vec2, Vec2)
Where the run places a child: its unrounded top-left in the run’s space, and its rounded one — each edge where taffy’s pass puts it, measured from the run’s node, a box in the flow.
Sourcepub fn child(&self, key: &OrderKey) -> Option<(f64, &Placed)>
pub fn child(&self, key: &OrderKey) -> Option<(f64, &Placed)>
The child at key: how far along the run the children before it
advance, and how it is placed.
Sourcepub fn prefix(&self, key: &OrderKey) -> f64
pub fn prefix(&self, key: &OrderKey) -> f64
How far along the run the children before key advance.
Sourcepub fn keys_after(&self, key: &OrderKey) -> Vec<OrderKey>
pub fn keys_after(&self, key: &OrderKey) -> Vec<OrderKey>
The keys of the children after key, in order.