[][src]Type Definition cursive::view::Position

type Position = XY<Offset>;

Location of the view on screen

Methods

impl Position[src]

pub fn center() -> Self[src]

Returns a position centered on both axis.

pub fn absolute<T: Into<Vec2>>(offset: T) -> Self[src]

Returns a position absolute on both axis.

pub fn parent<T: Into<XY<isize>>>(offset: T) -> Self[src]

Returns a position relative to the parent on both axis.

pub fn compute_offset<S, A, P>(&self, size: S, available: A, parent: P) -> Vec2 where
    S: Into<Vec2>,
    A: Into<Vec2>,
    P: Into<Vec2>, 
[src]

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.