Struct ambient_api::prelude::LayoutFreeCenter
source · pub struct LayoutFreeCenter {
pub inner: Element,
pub center_x: bool,
pub center_y: bool,
}
Expand description
Sets the translation
of inner
to offset its size in the selected axes.
Note that you will have to use another mechanism to move the inner element as a result.
Consider using layout centering where possible.
Fields§
§inner: Element
The element to center. Must have the corresponding size component(s) set (width
, height
).
center_x: bool
Whether or not to center on the X axis.
center_y: bool
Whether or not to center on the Y axis.
Implementations§
Trait Implementations§
source§impl Clone for LayoutFreeCenter
impl Clone for LayoutFreeCenter
source§fn clone(&self) -> LayoutFreeCenter
fn clone(&self) -> LayoutFreeCenter
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LayoutFreeCenter
impl Debug for LayoutFreeCenter
source§impl ElementComponent for LayoutFreeCenter
impl ElementComponent for LayoutFreeCenter
Auto Trait Implementations§
impl !RefUnwindSafe for LayoutFreeCenter
impl Send for LayoutFreeCenter
impl Sync for LayoutFreeCenter
impl Unpin for LayoutFreeCenter
impl !UnwindSafe for LayoutFreeCenter
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
source§impl<T> Downcast for T
impl<T> Downcast for T
source§impl<T> ElementComponentExt for Twhere
T: ElementComponent + 'static,
impl<T> ElementComponentExt for Twhere
T: ElementComponent + 'static,
source§impl<T> ElementComponentName for T
impl<T> ElementComponentName for T
source§fn element_component_name(&self) -> &'static str
fn element_component_name(&self) -> &'static str
Returns the name of the type implementing ElementComponent.