Struct paws::Rect

source · []
pub struct Rect {
    pub position: Point,
    pub size: Vector,
}
Expand description

An axis-aligned rectangle.

Fields

position: Pointsize: Vector

Implementations

Creates a new rectangle from a position and a size.

Returns the X coordinate of the rectangle’s position.

Returns the Y coordinate of the rectangle’s position.

Returns the width of the rectangle.

Returns the width of the rectangle.

Returns the left side of the rectangle.

Returns the top side of the rectangle.

Returns the right side of the rectangle.

Returns the bottom side of the rectangle.

Returns the top left corner of the rectangle.

Returns the top right corner of the rectangle.

Returns the bottom left corner of the rectangle.

Returns the bottom right corner of the rectangle.

Returns the center point of the rectangle.

Returns the horizontal (X) center of the rectangle.

Returns the vertical (Y) center of the rectangle.

Returns a sorted rectangle - that is, the same rectangle, but with the width and height guaranteed to be positive.

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.