pub struct Clamp {
pub max_override: (f32, f32),
pub anchor: (Anchor, Anchor),
/* private fields */
}Expand description
Limits a node’s maximum size.
If the node’s minimum size exceeds the maximum, the minimum takes precedence.
Fields§
§max_override: (f32, f32)The maximum size to maintain.
anchor: (Anchor, Anchor)The position to place the shrunken space. The child is then aligned within the new space.
Implementations§
Source§impl Clamp
impl Clamp
Sourcepub fn with_child(self, index: NodeIndex) -> Self
pub fn with_child(self, index: NodeIndex) -> Self
Sourcepub fn with_align(self, align: (Alignment, Alignment)) -> Self
pub fn with_align(self, align: (Alignment, Alignment)) -> Self
Set the horizontal and vertical alignment.
Sourcepub fn with_anchor(self, anchor: (Anchor, Anchor)) -> Self
pub fn with_anchor(self, anchor: (Anchor, Anchor)) -> Self
Set the horizontal and vertical anchor mode for the shrunken space.
Sourcepub fn with_max(self, max: (f32, f32)) -> Self
pub fn with_max(self, max: (f32, f32)) -> Self
Set the maximum size.
If the maximum size is smaller than the minimum size, the minimum takes precedence.
Trait Implementations§
Source§impl UiNode for Clamp
impl UiNode for Clamp
Source§fn get_align_mut(&mut self) -> (&mut Alignment, &mut Alignment)
fn get_align_mut(&mut self) -> (&mut Alignment, &mut Alignment)
Get a mutable reference to the alignment of the node.
Source§fn calculate_min_size(&self, tree: &UiTree) -> (f32, f32)
fn calculate_min_size(&self, tree: &UiTree) -> (f32, f32)
Calculate the minimum size of the node. Read more
Source§fn calculate_rects(&self, cache: &NodeCache, tree: &UiTree) -> Vec<Rect>
fn calculate_rects(&self, cache: &NodeCache, tree: &UiTree) -> Vec<Rect>
Recalculate the position and size of child nodes, in the same order and count as
get_visible_children. Read moreSource§fn get_children(&self) -> Vec<NodeIndex>
fn get_children(&self) -> Vec<NodeIndex>
Get all children of the node, if applicable.
Auto Trait Implementations§
impl Freeze for Clamp
impl RefUnwindSafe for Clamp
impl Send for Clamp
impl Sync for Clamp
impl Unpin for Clamp
impl UnsafeUnpin for Clamp
impl UnwindSafe for Clamp
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