Struct euclid::rect::Rect
[−]
[src]
pub struct Rect<T> { pub origin: Point2D<T>, pub size: Size2D<T>, }
Fields
origin | |
size |
Methods
impl<T: Clone> Rect<T>
impl<T: Copy + Clone + PartialOrd + Add<T, Output=T> + Sub<T, Output=T>> Rect<T>
fn intersects(&self, other: &Rect<T>) -> bool
fn max_x(&self) -> T
fn min_x(&self) -> T
fn max_y(&self) -> T
fn min_y(&self) -> T
fn intersection(&self, other: &Rect<T>) -> Option<Rect<T>>
fn translate(&self, other: &Point2D<T>) -> Rect<T>
fn contains(&self, other: &Point2D<T>) -> bool
fn inflate(&self, width: T, height: T) -> Rect<T>
fn top_right(&self) -> Point2D<T>
fn bottom_left(&self) -> Point2D<T>
fn bottom_right(&self) -> Point2D<T>
fn translate_by_size(&self, size: &Size2D<T>) -> Rect<T>
impl<T: Copy + Clone + PartialOrd + Add<T, Output=T> + Sub<T, Output=T> + Zero> Rect<T>
impl<T> Rect<T>
fn scale<Scale: Copy>(&self, x: Scale, y: Scale) -> Rect<T> where T: Copy + Clone + Mul<Scale, Output=T>
impl<T: PartialEq + Zero> Rect<T>
impl<Unit, T: Clone> Rect<Length<Unit, T>>
fn to_untyped(&self) -> Rect<T>
Drop the units, preserving only the numeric value.
fn from_untyped(r: &Rect<T>) -> TypedRect<Unit, T>
Tag a unitless value with units.
impl<Unit, T0: NumCast + Clone> Rect<Length<Unit, T0>>
fn cast<T1: NumCast + Clone>(&self) -> Option<Rect<Length<Unit, T1>>>
Cast from one numeric representation to another, preserving the units.