[−][src]Struct beryllium::Rect
Rectangle struct, origin at the upper left.
Naturally, having the origin at the upper left is a terrible and heretical coordinate system to use, but that's what SDL2 does so that's what we're stuck with.
Note: This type has been rewritten in Rust.
Fields
x: i32
y: i32
w: i32
h: i32
Methods
impl Rect
[src]
pub fn contains_point(&self, px: i32, py: i32) -> bool
[src]
Returns true if the point resides in this rect.
A rect is inclusive with the upper and right sides, and exclusive with the lower and left sides.
pub fn is_empty(&self) -> bool
[src]
Returns true if the rectangle has no area.
pub fn intersect(&self, other: &Rect) -> Rect
[src]
Gives a Rect
that's the intersection between this and the other rect.
- If either Rect in the intersection is empty you get a default Rect.
pub fn union(&self, other: &Rect) -> Rect
[src]
Gives a Rect
that's a union between this and the other rect.
- If self is empty, you just get the other rect.
- If the other rect is empty, you just get self.
- If both are empty then you get a default rect.
Trait Implementations
impl From<SDL_Rect> for Rect
[src]
impl From<Rect> for SDL_Rect
[src]
impl PartialEq<Rect> for Rect
[src]
impl Clone for Rect
[src]
fn clone(&self) -> Rect
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for Rect
[src]
impl Eq for Rect
[src]
impl Copy for Rect
[src]
impl Debug for Rect
[src]
Auto Trait Implementations
impl Send for Rect
impl Unpin for Rect
impl Sync for Rect
impl UnwindSafe for Rect
impl RefUnwindSafe for Rect
Blanket Implementations
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,