Struct guion::util::bounds::Bounds[][src]

pub struct Bounds {
    pub off: Offset,
    pub size: Dims,
}

Fields

off: Offsetsize: Dims

Implementations

impl Bounds[src]

pub const fn from_xywh(x: i32, y: i32, w: u32, h: u32) -> Self[src]

pub fn from_xyxy(x0: i32, y0: i32, x1: i32, y1: i32) -> Self[src]

pub const fn from_xy(x: i32, y: i32) -> Self[src]

pub const fn from_wh(w: u32, h: u32) -> Self[src]

pub const fn from_off(off: Offset) -> Self[src]

pub const fn from_size(size: Dims) -> Self[src]

pub const fn x(&self) -> i32[src]

pub const fn y(&self) -> i32[src]

pub const fn w(&self) -> u32[src]

pub const fn h(&self) -> u32[src]

pub fn x_mut(&mut self) -> &mut i32[src]

pub fn y_mut(&mut self) -> &mut i32[src]

pub fn w_mut(&mut self) -> &mut u32[src]

pub fn h_mut(&mut self) -> &mut u32[src]

pub const fn x1(&self) -> i32[src]

pub const fn y1(&self) -> i32[src]

pub const fn center(&self) -> Offset[src]

pub fn inside_border(&self, b: &Border) -> Self[src]

Get the bounds inside this bound (subtract border)

pub fn slice(&self, inner_relative: &Bounds) -> Self[src]

Get the part of the inner which also is inside this bound

Use the BitAnd operator if the inner bound is absolute

pub fn step(&self, step: i32) -> Self[src]

pub const fn inner_centered(&self, size: Dims) -> Self[src]

Get bound with size s and centered relative to self

pub fn inner_aligned(&self, size: Dims, align: (f32, f32)) -> Self[src]

inner_centered but advanced

align: is the start-to-end relative position (0.0 - 1.0)

pub fn inner_aligned_f(&self, size: (f32, f32), align: (f32, f32)) -> Self[src]

inner_centered but advanced

align: the start-to-end relative position (0.0 - 1.0)

pub fn from_ori(
    par_off: i32,
    unpar_off: i32,
    par_size: u32,
    unpar_size: u32,
    o: Orientation
) -> Self
[src]

pub fn par(&self, o: Orientation) -> (i32, u32)[src]

pub fn unpar(&self, o: Orientation) -> (i32, u32)[src]

pub fn not_empty(&self) -> bool[src]

pub fn shift_to_fit(&mut self, inner_abs: &Bounds)[src]

Trait Implementations

impl Add<&'_ Offset> for Bounds[src]

type Output = Bounds

The resulting type after applying the + operator.

impl<'a> Add<&'_ Offset> for &'a Bounds[src]

type Output = Bounds

The resulting type after applying the + operator.

impl<'a> Add<&'_ Offset> for &'a mut Bounds[src]

type Output = Bounds

The resulting type after applying the + operator.

impl Add<&'_ mut Offset> for Bounds[src]

type Output = Bounds

The resulting type after applying the + operator.

impl<'a> Add<&'_ mut Offset> for &'a Bounds[src]

type Output = Bounds

The resulting type after applying the + operator.

impl<'a> Add<&'_ mut Offset> for &'a mut Bounds[src]

type Output = Bounds

The resulting type after applying the + operator.

impl Add<Offset> for Bounds[src]

type Output = Bounds

The resulting type after applying the + operator.

impl<'a> Add<Offset> for &'a Bounds[src]

type Output = Bounds

The resulting type after applying the + operator.

impl<'a> Add<Offset> for &'a mut Bounds[src]

type Output = Bounds

The resulting type after applying the + operator.

impl AddAssign<&'_ Offset> for Bounds[src]

impl<'a> AddAssign<&'_ Offset> for &'a mut Bounds[src]

impl AddAssign<&'_ mut Offset> for Bounds[src]

impl<'a> AddAssign<&'_ mut Offset> for &'a mut Bounds[src]

impl AddAssign<Offset> for Bounds[src]

impl<'a> AddAssign<Offset> for &'a mut Bounds[src]

impl<E> BitAnd<&'_ Bounds> for &EventCompound<E> where
    E: Env
[src]

type Output = EventCompound<E>

The resulting type after applying the & operator.

impl BitAnd<&'_ Bounds> for Bounds[src]

type Output = Bounds

The resulting type after applying the & operator.

impl<'a> BitAnd<&'_ Bounds> for &'a Bounds[src]

type Output = Bounds

The resulting type after applying the & operator.

impl<'a> BitAnd<&'_ Bounds> for &'a mut Bounds[src]

type Output = Bounds

The resulting type after applying the & operator.

impl BitAnd<&'_ mut Bounds> for Bounds[src]

type Output = Bounds

The resulting type after applying the & operator.

impl<'a> BitAnd<&'_ mut Bounds> for &'a Bounds[src]

type Output = Bounds

The resulting type after applying the & operator.

impl<'a> BitAnd<&'_ mut Bounds> for &'a mut Bounds[src]

type Output = Bounds

The resulting type after applying the & operator.

impl BitAnd<Bounds> for Bounds[src]

type Output = Bounds

The resulting type after applying the & operator.

impl<'a> BitAnd<Bounds> for &'a Bounds[src]

type Output = Bounds

The resulting type after applying the & operator.

impl<'a> BitAnd<Bounds> for &'a mut Bounds[src]

type Output = Bounds

The resulting type after applying the & operator.

impl BitAndAssign<&'_ Bounds> for Bounds[src]

impl<'a> BitAndAssign<&'_ Bounds> for &'a mut Bounds[src]

impl BitAndAssign<&'_ mut Bounds> for Bounds[src]

impl<'a> BitAndAssign<&'_ mut Bounds> for &'a mut Bounds[src]

impl BitAndAssign<Bounds> for Bounds[src]

impl<'a> BitAndAssign<Bounds> for &'a mut Bounds[src]

impl Clone for Bounds[src]

impl Copy for Bounds[src]

impl Debug for Bounds[src]

impl Default for Bounds[src]

impl Sub<&'_ Offset> for Bounds[src]

type Output = Bounds

The resulting type after applying the - operator.

impl<'a> Sub<&'_ Offset> for &'a Bounds[src]

type Output = Bounds

The resulting type after applying the - operator.

impl<'a> Sub<&'_ Offset> for &'a mut Bounds[src]

type Output = Bounds

The resulting type after applying the - operator.

impl Sub<&'_ mut Offset> for Bounds[src]

type Output = Bounds

The resulting type after applying the - operator.

impl<'a> Sub<&'_ mut Offset> for &'a Bounds[src]

type Output = Bounds

The resulting type after applying the - operator.

impl<'a> Sub<&'_ mut Offset> for &'a mut Bounds[src]

type Output = Bounds

The resulting type after applying the - operator.

impl Sub<Offset> for Bounds[src]

type Output = Bounds

The resulting type after applying the - operator.

impl<'a> Sub<Offset> for &'a Bounds[src]

type Output = Bounds

The resulting type after applying the - operator.

impl<'a> Sub<Offset> for &'a mut Bounds[src]

type Output = Bounds

The resulting type after applying the - operator.

impl SubAssign<&'_ Offset> for Bounds[src]

impl<'a> SubAssign<&'_ Offset> for &'a mut Bounds[src]

impl SubAssign<&'_ mut Offset> for Bounds[src]

impl<'a> SubAssign<&'_ mut Offset> for &'a mut Bounds[src]

impl SubAssign<Offset> for Bounds[src]

impl<'a> SubAssign<Offset> for &'a mut Bounds[src]

Auto Trait Implementations

impl RefUnwindSafe for Bounds

impl Send for Bounds

impl Sync for Bounds

impl Unpin for Bounds

impl UnwindSafe for Bounds

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<E, T> AtomState<E, T> for T where
    E: Env,
    T: Clone
[src]

impl<E, T> AtomStateMut<E, T> for T where
    E: Env,
    T: Clone
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> FromInto<U> for T where
    T: From<U> + Into<U>, 
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<'_, S, T, E> StyleSelectorAppend<&'_ S, E> for T where
    T: StyleSelectorAppend<S, E>,
    S: StyleSelectag<E>, 
[src]

impl<'a, S, T, E> StyleSelectorAppend<&'a [S], E> for T where
    T: StyleSelectorAppend<S, E>,
    S: StyleSelectag<E>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.