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: f32miny: f32maxx: f32maxy: f32

Implementations

Create a new Rect.

Cut out the left of the rect, returning the left piece and modifying the original Rect.

Cut out the right of the rect, returning the right piece and modifying the original Rect.

Cut out the top of the rect, returning the top piece and modifying the original Rect.

Cut out the bottom of the rect, returning the bottom piece and modifying the original Rect.

Cut out the left of the rect, leaving the original unmodified.

Cut out the right of the rect, leaving the original unmodified.

Cut out the top of the rect, leaving the original unmodified.

Cut out the bottom of the rect, leaving the original unmodified.

Create a rect that extends the given rect out to the left, leaving the original unmodified.

Create a rect that extends the given rect out to the right, leaving the original unmodified.

Create a rect that extends the given rect out to the top, leaving the original unmodified.

Create a rect that extends the given rect out to the bottom, leaving the original unmodified.

Extend the rect out in all directions, leaving the original unmodified.

Conctract the rect in all directions, leaving the original unmodified.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.