pub struct MacRow {
pub y_offset: f32,
pub height: f32,
pub cursor_x: f32,
pub item_spacing: f32,
pub container_width: f32,
}Expand description
Deterministic horizontal row container with fixed height and spacing budget.
Fields§
§y_offset: f32Vertical offset of the row in container coordinates.
height: f32Fixed row height in points.
cursor_x: f32Horizontal cursor advancing as cells are allocated.
item_spacing: f32Spacing between adjacent cells in points.
container_width: f32Total available container width in points.
Implementations§
Source§impl MacRow
impl MacRow
Sourcepub fn new(
y_offset: f32,
height: f32,
container_width: f32,
item_spacing: f32,
) -> Self
pub fn new( y_offset: f32, height: f32, container_width: f32, item_spacing: f32, ) -> Self
Creates a new MacRow container.
Sourcepub fn allocate_cell(&mut self, width: f32) -> (f32, f32, f32, f32)
pub fn allocate_cell(&mut self, width: f32) -> (f32, f32, f32, f32)
Allocates next cell of width width, advancing cursor with spacing.
Returns relative bounds (x, y, width, height).
Sourcepub fn remaining_width(&self) -> f32
pub fn remaining_width(&self) -> f32
Returns remaining horizontal budget in points.
Trait Implementations§
impl Copy for MacRow
impl StructuralPartialEq for MacRow
Auto Trait Implementations§
impl Forget for MacRow
impl Freeze for MacRow
impl RefUnwindSafe for MacRow
impl Send for MacRow
impl Sync for MacRow
impl Unpin for MacRow
impl UnsafeUnpin for MacRow
impl UnwindSafe for MacRow
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more