pub struct ChildLayout {
pub offset: Offset,
pub size: Size,
pub paint_bounds: Rect,
pub visual_bounds: Rect,
}Expand description
Geometry assigned to one direct child by its parent.
All coordinates and dimensions are logical pixels. offset is relative to
the parent, while both bounds are expressed in that same parent-local space.
Values are stored verbatim; this type does not reject negative or non-finite
geometry.
§Examples
use ailloli_ui_core::{Offset, Rect, Size};
use ailloli_ui_runtime::layout::ChildLayout;
let child = ChildLayout {
offset: Offset::new(4.0, 6.0),
size: Size::new(20.0, 10.0),
paint_bounds: Rect::new(4.0, 6.0, 20.0, 10.0),
visual_bounds: Rect::new(3.0, 5.0, 22.0, 12.0),
};
assert_eq!(child.offset.x, 4.0);Fields§
§offset: OffsetChild origin relative to the parent, in logical pixels.
size: SizeMeasured child size in logical pixels.
paint_bounds: RectRegion the child can paint, expressed in parent-local coordinates.
visual_bounds: RectRegion containing the child’s visual effects, in parent-local coordinates.
Trait Implementations§
Source§impl Clone for ChildLayout
impl Clone for ChildLayout
Source§fn clone(&self) -> ChildLayout
fn clone(&self) -> ChildLayout
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 ChildLayout
impl Debug for ChildLayout
Source§impl PartialEq for ChildLayout
impl PartialEq for ChildLayout
impl StructuralPartialEq for ChildLayout
Auto Trait Implementations§
impl Freeze for ChildLayout
impl RefUnwindSafe for ChildLayout
impl Send for ChildLayout
impl Sync for ChildLayout
impl Unpin for ChildLayout
impl UnwindSafe for ChildLayout
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
Source§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.