Type Definition cursive::view::Position
[−]
[src]
type Position = XY<Offset>;
Location of the view on screen
Methods
impl Position
[src]
fn center() -> Self
Returns a position centered on both axis.
fn absolute<T: Into<Vec2>>(offset: T) -> Self
Returns a position absolute on both axis.
fn parent<T: Into<XY<isize>>>(offset: T) -> Self
Returns a position relative to the parent on both axis.
fn compute_offset<S, A, P>(&self, size: S, available: A, parent: P) -> Vec2 where
S: Into<Vec2>,
A: Into<Vec2>,
P: Into<Vec2>,
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.