Struct rect_packer::Rect [−][src]
Rectangle with integer coordinates.
Fields
x: i32
y: i32
width: i32
height: i32
Implementations
impl Rect
[src]
impl Rect
[src]pub fn new(x: i32, y: i32, width: i32, height: i32) -> Rect
[src]
pub fn top(&self) -> i32
[src]
pub fn bottom(&self) -> i32
[src]
pub fn left(&self) -> i32
[src]
pub fn right(&self) -> i32
[src]
pub fn area(&self) -> i32
[src]
pub fn intersects(&self, other: &Rect) -> bool
[src]
Check if intersection of two rectangles is non empty.
pub fn contains(&self, other: &Rect) -> bool
[src]
Check if other
rectangle is completely inside self
.
pub fn contains_point(&self, x: i32, y: i32) -> bool
[src]
Check if given pixel is inside this rectangle.