Struct emath::RectTransform[][src]

pub struct RectTransform { /* fields omitted */ }

Linearly transforms positions from one Rect to another.

RectTransform stores the rectangles, and therefore supports clamping and culling.

Implementations

impl RectTransform[src]

pub fn identity(from_and_to: Rect) -> Self[src]

pub fn from_to(from: Rect, to: Rect) -> Self[src]

pub fn from(&self) -> &Rect[src]

pub fn to(&self) -> &Rect[src]

pub fn scale(&self) -> Vec2[src]

The scale factors.

pub fn inverse(&self) -> RectTransform[src]

pub fn transform_pos(&self, pos: Pos2) -> Pos2[src]

Transforms the given coordinate in the from space to the to space.

pub fn transform_rect(&self, rect: Rect) -> Rect[src]

Transforms the given rectangle in the in-space to a rectangle in the out-space.

pub fn transform_pos_clamped(&self, pos: Pos2) -> Pos2[src]

Transforms the given coordinate in the from space to the to space, clamping if necessary.

Trait Implementations

impl Clone for RectTransform[src]

impl Copy for RectTransform[src]

impl Debug for RectTransform[src]

impl Mul<Pos2> for RectTransform[src]

Transforms the position.

type Output = Pos2

The resulting type after applying the * operator.

impl Mul<Pos2> for &RectTransform[src]

Transforms the position.

type Output = Pos2

The resulting type after applying the * operator.

impl PartialEq<RectTransform> for RectTransform[src]

impl StructuralPartialEq for RectTransform[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[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> Into<U> for T where
    U: From<T>, 
[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.