[−][src]Trait pane::math::Rectangle
A trait for manipulating rectangles
Associated Types
Loading content...Required methods
fn new(top_left: Self::Vector, size: Self::Vector) -> Self
Create a new rectangle from a top-left corner position and a size
fn top_left(&self) -> Self::Vector
Get the top-left corner position
fn size(&self) -> Self::Vector
Get the size
Provided methods
fn map<R>(&self) -> R where
R: Rectangle,
R::Scalar: From<Self::Scalar>,
R: Rectangle,
R::Scalar: From<Self::Scalar>,
Map this rectangle to a rectangle of another type
fn top_right(&self) -> Self::Vector
Get the top-right corner position
fn bottom_left(&self) -> Self::Vector
Get the bottom-left corner position
fn bottom_right(&self) -> Self::Vector
Get the bottom-right corner position
fn top(&self) -> Self::Scalar
Get the top y
fn bottom(&self) -> Self::Scalar
Get the bottom y
fn left(&self) -> Self::Scalar
Get the left x
fn right(&self) -> Self::Scalar
Get the right x
fn width(&self) -> Self::Scalar
Get the width
fn height(&self) -> Self::Scalar
Get the height
fn center(&self) -> Self::Vector
Get the position of the center
fn with_top_left(self, top_left: Self::Vector) -> Self
Transform the rectangle into one with a different top-left corner position
fn with_size(self, size: Self::Vector) -> Self
Transform the rectangle into one with a different size