pub struct Row { /* private fields */ }Expand description
Builds a horizontal measured layout; defaults to zero gap and Start alignment.
Children are positioned in insertion order, then painted in stable z order. Empty nodes consume no gap; declared points and lines still occupy a slot. A child’s existing transformed AABB supplies its size; its previous position is replaced by arrangement. Parent placement and opacity apply afterwards.
use motion_core::prelude::*;
use motion_core::{
DisplayList, RasterLimits, ResourceStore, ValidatedDisplayList, MAX_PATH_VERBS,
MAX_STROKE_VERBS, MAX_SVG_PATH_BYTES, sample_offsets,
};
let tile = || Node::from(Rect::new(0.0, 0.0, 10.0, 20.0).fill(Color::rgb(20, 150, 125)));
let row = Row::new().gap(12.0).children([tile(), tile()]);
assert_eq!(
row.measure(ValidationLimits::default())?,
Rect::new(0.0, 0.0, 32.0, 20.0)
);
let column = Column::new()
.gap(4.0)
.alignment(Alignment::End)
.children([row, tile()])
.at(Point::new(100.0, 80.0));
assert_eq!(
column.measure(ValidationLimits::default())?,
Rect::new(84.0, 58.0, 116.0, 102.0)
);
let list = column.compile(
Size::new(200.0, 160.0),
PixelSize::new(200, 160),
ValidationLimits::default(),
)?;
assert_eq!(list.commands.len(), 3);Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Forget for Row
impl Freeze for Row
impl Move for Row
impl RefUnwindSafe for Row
impl Send for Row
impl Sync for Row
impl Unpin for Row
impl UnsafeUnpin for Row
impl UnwindSafe for Row
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more