Expand description
Location of the view on screen
Implementations
sourceimpl Position
impl Position
sourcepub fn parent<T: Into<XY<isize>>>(offset: T) -> Self
pub fn parent<T: Into<XY<isize>>>(offset: T) -> Self
Returns a position relative to the parent on both axis.
sourcepub fn compute_offset<S, A, P>(&self, size: S, available: A, parent: P) -> Vec2where
S: Into<Vec2>,
A: Into<Vec2>,
P: Into<Vec2>,
pub fn compute_offset<S, A, P>(&self, size: S, available: A, parent: P) -> Vec2where
S: Into<Vec2>,
A: Into<Vec2>,
P: Into<Vec2>,
Computes the offset required to draw a view.
When drawing a view with size
in a container with available
,
and a parent with the absolute coordinates parent
, drawing the
child with its top-left corner at the returned coordinates will
position him appropriately.