Trait pane::math::Rectangle

source ·
pub trait Rectangle: Clone {
    type Scalar: Scalar;
    type Vector: Vector2<Scalar = Self::Scalar>;

Show 16 methods fn new(top_left: Self::Vector, size: Self::Vector) -> Self; fn top_left(&self) -> Self::Vector; fn size(&self) -> Self::Vector; fn map<R>(&self) -> R
    where
        R: Rectangle,
        R::Scalar: From<Self::Scalar>
, { ... } fn top_right(&self) -> Self::Vector { ... } fn bottom_left(&self) -> Self::Vector { ... } fn bottom_right(&self) -> Self::Vector { ... } fn top(&self) -> Self::Scalar { ... } fn bottom(&self) -> Self::Scalar { ... } fn left(&self) -> Self::Scalar { ... } fn right(&self) -> Self::Scalar { ... } fn width(&self) -> Self::Scalar { ... } fn height(&self) -> Self::Scalar { ... } fn center(&self) -> Self::Vector { ... } fn with_top_left(self, top_left: Self::Vector) -> Self { ... } fn with_size(self, size: Self::Vector) -> Self { ... }
}
Expand description

A trait for manipulating rectangles

Required Associated Types

The scalar type

The vector type

Required Methods

Create a new rectangle from a top-left corner position and a size

Get the top-left corner position

Get the size

Provided Methods

Map this rectangle to a rectangle of another type

Get the top-right corner position

Get the bottom-left corner position

Get the bottom-right corner position

Get the top y

Get the bottom y

Get the left x

Get the right x

Get the width

Get the height

Get the position of the center

Transform the rectangle into one with a different top-left corner position

Transform the rectangle into one with a different size

Implementors