Struct shapes::Rect [−][src]
Expand description
A rectangle.
Fields
pos: PointThe position of the top left corner of the rectangle.
size: SizeThe width and height of the rectangle.
Implementations
Computes a rectangle with quadruple the surface area of self and with center (self.x, self.y).
Compute whether or not the point is inside the rectangle.
Create a rectangle that circumscribes the given circle.
Create a square rectangle with sides of length len and top left corner at pos.
Computes a rectangle whose perimeter forms the inside edge of margin with size m for self.
Computes a rectangle translated (slid) in the direction of the vector a distance relative to the size of the rectangle. For example, self.relative([1.0, 1.0]) returns a rectangle one rectangle to the right and down from the original.
Computes a scaled rectangle with the same position as self.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Rect
impl UnwindSafe for Rect
Blanket Implementations
Mutably borrows from an owned value. Read more