[−][src]Struct quicksilver::geom::Rectangle
A rectangle with a top-left position and a size
Fields
pos: Vector
The top-left coordinate of the rectangle
size: Vector
The width and height of the rectangle
Implementations
impl Rectangle
[src]
pub fn new(pos: Vector, size: Vector) -> Rectangle
[src]
Create a rectangle from a top-left vector and a size vector
pub fn new_sized(size: Vector) -> Rectangle
[src]
Create a rectangle at the origin with the given size
pub fn top_left(&self) -> Vector
[src]
Get the top left coordinate of the Rectangle
pub fn x(&self) -> f32
[src]
Get the x-coordinate of the Rectangle (The origin of a Rectangle is at the top left)
pub fn y(&self) -> f32
[src]
Get the y-coordinate of the Rectangle (The origin of a Rectangle is at the top left)
pub fn size(&self) -> Vector
[src]
Get the size of the Rectangle
pub fn height(&self) -> f32
[src]
Get the height of the Rectangle
pub fn width(&self) -> f32
[src]
Get the width of the Rectangle
Trait Implementations
impl Clone for Rectangle
[src]
impl Copy for Rectangle
[src]
impl Debug for Rectangle
[src]
impl Default for Rectangle
[src]
impl Eq for Rectangle
[src]
impl PartialEq<Rectangle> for Rectangle
[src]
impl Shape for Rectangle
[src]
fn contains(&self, p: Vector) -> bool
[src]
fn overlaps_circle(&self, c: &Circle) -> bool
[src]
fn overlaps_rectangle(&self, b: &Rectangle) -> bool
[src]
fn intersects(&self, l: &Line) -> bool
[src]
fn overlaps(&self, shape: &impl Shape) -> bool
[src]
fn center(&self) -> Vector
[src]
fn bounding_box(&self) -> Rectangle
[src]
fn translate(&self, v: Vector) -> Self
[src]
#[must_use]fn transformed_bounding_box(&self, transform: Transform) -> Rectangle
[src]
#[must_use]fn constrain(&self, outer: &Rectangle) -> Self where
Self: Sized,
[src]
Self: Sized,
#[must_use]fn with_center(&self, center: Vector) -> Self where
Self: Sized,
[src]
Self: Sized,
Auto Trait Implementations
impl RefUnwindSafe for Rectangle
impl Send for Rectangle
impl Sync for Rectangle
impl Unpin for Rectangle
impl UnwindSafe for Rectangle
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,