pub struct Rect {
pub minx: f32,
pub miny: f32,
pub maxx: f32,
pub maxy: f32,
}
Expand description
The Rect struct represents an area, such as an area of the screen, by its minimum x and y and maximum x and y.
Fields§
§minx: f32
§miny: f32
§maxx: f32
§maxy: f32
Implementations§
Source§impl Rect
impl Rect
Sourcepub fn cut_left(&mut self, a: f32) -> Rect
pub fn cut_left(&mut self, a: f32) -> Rect
Cut out the left of the rect, returning the left piece and modifying the original Rect.
Sourcepub fn cut_right(&mut self, a: f32) -> Rect
pub fn cut_right(&mut self, a: f32) -> Rect
Cut out the right of the rect, returning the right piece and modifying the original Rect.
Sourcepub fn cut_top(&mut self, a: f32) -> Rect
pub fn cut_top(&mut self, a: f32) -> Rect
Cut out the top of the rect, returning the top piece and modifying the original Rect.
Sourcepub fn cut_bottom(&mut self, a: f32) -> Rect
pub fn cut_bottom(&mut self, a: f32) -> Rect
Cut out the bottom of the rect, returning the bottom piece and modifying the original Rect.
Sourcepub fn get_left(&self, a: f32) -> Rect
pub fn get_left(&self, a: f32) -> Rect
Cut out the left of the rect, leaving the original unmodified.
Sourcepub fn get_right(&self, a: f32) -> Rect
pub fn get_right(&self, a: f32) -> Rect
Cut out the right of the rect, leaving the original unmodified.
Sourcepub fn get_top(&self, a: f32) -> Rect
pub fn get_top(&self, a: f32) -> Rect
Cut out the top of the rect, leaving the original unmodified.
Sourcepub fn get_bottom(&self, a: f32) -> Rect
pub fn get_bottom(&self, a: f32) -> Rect
Cut out the bottom of the rect, leaving the original unmodified.
Sourcepub fn add_left(&self, a: f32) -> Rect
pub fn add_left(&self, a: f32) -> Rect
Create a rect that extends the given rect out to the left, leaving the original unmodified.
Sourcepub fn add_right(&self, a: f32) -> Rect
pub fn add_right(&self, a: f32) -> Rect
Create a rect that extends the given rect out to the right, leaving the original unmodified.
Sourcepub fn add_top(&self, a: f32) -> Rect
pub fn add_top(&self, a: f32) -> Rect
Create a rect that extends the given rect out to the top, leaving the original unmodified.
Sourcepub fn add_bottom(&self, a: f32) -> Rect
pub fn add_bottom(&self, a: f32) -> Rect
Create a rect that extends the given rect out to the bottom, leaving the original unmodified.