pub struct Layout {
pub order: u32,
pub location: Point<f32>,
pub size: Size<f32>,
pub content_size: Size<f32>,
pub scrollbar_size: Size<f32>,
pub border: Rect<f32>,
pub padding: Rect<f32>,
}
Expand description
The final result of a layout algorithm for a single node.
Fields§
§order: u32
The relative ordering of the node
Nodes with a higher order should be rendered on top of those with a lower order. This is effectively a topological sort of each tree.
location: Point<f32>
The top-left corner of the node
size: Size<f32>
The width and height of the node
content_size: Size<f32>
The width and height of the content inside the node. This may be larger than the size of the node in the case of overflowing content and is useful for computing a “scroll width/height” for scrollable nodes
scrollbar_size: Size<f32>
The size of the scrollbars in each dimension. If there is no scrollbar then the size will be zero.
border: Rect<f32>
The size of the borders of the node
padding: Rect<f32>
The size of the padding of the node
Implementations§
source§impl Layout
impl Layout
source§impl Layout
impl Layout
sourcepub fn scroll_width(&self) -> f32
pub fn scroll_width(&self) -> f32
Return the scroll width of the node. The scroll width is the difference between the width and the content width, floored at zero
sourcepub fn scroll_height(&self) -> f32
pub fn scroll_height(&self) -> f32
Return the scroll width of the node. The scroll width is the difference between the width and the content width, floored at zero
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnwindSafe for Layout
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)