Struct rect_packer::Rect
[−]
[src]
pub struct Rect { pub x: i32, pub y: i32, pub width: i32, pub height: i32, }
Rectangle with integer coordinates.
Fields
x: i32
y: i32
width: i32
height: i32
Methods
impl Rect
[src]
fn new(x: i32, y: i32, width: i32, height: i32) -> Rect
[src]
fn top(&self) -> i32
[src]
fn bottom(&self) -> i32
[src]
fn left(&self) -> i32
[src]
fn right(&self) -> i32
[src]
fn area(&self) -> i32
[src]
fn intersects(&self, other: &Rect) -> bool
[src]
Check if intersection of two rectangles is non empty.
fn contains(&self, other: &Rect) -> bool
[src]
Check if other
rectangle is completely inside self
.
fn contains_point(&self, x: i32, y: i32) -> bool
[src]
Check if given pixel is inside this rectangle.
Trait Implementations
impl Copy for Rect
[src]
impl Clone for Rect
[src]
fn clone(&self) -> Rect
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Rect
[src]
impl Eq for Rect
[src]
impl PartialEq for Rect
[src]
fn eq(&self, __arg_0: &Rect) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Rect) -> bool
[src]
This method tests for !=
.