Struct nannou::geom::rect::Rect [] [src]

pub struct Rect<S = f64> {
    pub x: Range<S>,
    pub y: Range<S>,
}

Defines a Rectangle's bounds across the x and y axes.

Fields

The start and end positions of the Rectangle on the x axis.

The start and end positions of the Rectangle on the y axis.

Methods

impl<S> Rect<S> where
    S: BaseNum
[src]

[src]

Construct a Rect from a given Point and Dimensions.

[src]

Construct a Rect from the coordinates of two points.

[src]

The Rect representing the area in which two Rects overlap.

[src]

The Rect that encompass the two given sets of Rect.

[src]

The position in the middle of the x bounds.

[src]

The position in the middle of the y bounds.

[src]

The xy position in the middle of the bounds.

[src]

The centered x and y coordinates as a tuple.

[src]

The Rect's lowest y value.

[src]

The Rect's highest y value.

[src]

The Rect's lowest x value.

[src]

The Rect's highest x value.

[src]

The top left corner Point.

[src]

The bottom left corner Point.

[src]

The top right corner Point.

[src]

The bottom right corner Point.

[src]

The edges of the Rect in a tuple (top, bottom, left, right).

[src]

Shift the Rect along the x axis.

[src]

Shift the Rect along the y axis.

[src]

Shift the Rect by the given Point.

[src]

Does the given point touch the Rectangle.

[src]

Stretches the closest edge(s) to the given point if the point lies outside of the Rect area.

[src]

Align self's right edge with the left edge of the other Rect.

[src]

Align self's left edge with the right dge of the other Rect.

[src]

Align self's top edge with the bottom edge of the other Rect.

[src]

Align self's bottom edge with the top edge of the other Rect.

[src]

Align self to other along the x axis in accordance with the given Align variant.

[src]

Align self to other along the y axis in accordance with the given Align variant.

[src]

Align self's left edge with the left edge of the other Rect.

[src]

Align the middle of self with the middle of the other Rect along the x axis.

[src]

Align self's right edge with the right edge of the other Rect.

[src]

Align self's bottom edge with the bottom edge of the other Rect.

[src]

Align the middle of self with the middle of the other Rect along the y axis.

[src]

Align self's top edge with the top edge of the other Rect.

[src]

Place self along the top left edges of the other Rect.

[src]

Place self along the top right edges of the other Rect.

[src]

Place self along the bottom left edges of the other Rect.

[src]

Place self along the bottom right edges of the other Rect.

[src]

Place self in the middle of the top edge of the other Rect.

[src]

Place self in the middle of the bottom edge of the other Rect.

[src]

Place self in the middle of the left edge of the other Rect.

[src]

Place self in the middle of the right edge of the other Rect.

[src]

Place self directly in the middle of the other Rect.

[src]

Return the Corner of self that is closest to the given Point.

[src]

Thee four corners of the Rect.

[src]

Return two Tris that represent the Rect.

impl<S> Rect<S> where
    S: BaseNum + Neg<Output = S>, 
[src]

[src]

The width of the Rect.

[src]

The height of the Rect.

[src]

The total dimensions of the Rect.

[src]

The width and height of the Rect as a tuple.

[src]

Convert the Rect to a Point and Dimensions.

[src]

The Rect's centered coordinates and dimensions in a tuple.

[src]

The length of the longest side of the rectangle.

[src]

The left and top edges of the Rect along with the width and height.

[src]

The left and bottom edges of the Rect along with the width and height.

[src]

The Rect with some padding applied to the left edge.

[src]

The Rect with some padding applied to the right edge.

[src]

The rect with some padding applied to the bottom edge.

[src]

The Rect with some padding applied to the top edge.

[src]

The Rect with some padding amount applied to each edge.

[src]

The Rect with some padding applied.

[src]

Returns a Rect with a position relative to the given position on the x axis.

[src]

Returns a Rect with a position relative to the given position on the y axis.

[src]

Returns a Rect with a position relative to the given position.

Trait Implementations

impl<S: Copy> Copy for Rect<S>
[src]

impl<S: Clone> Clone for Rect<S>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<S: Debug> Debug for Rect<S>
[src]

[src]

Formats the value using the given formatter.

impl<S: PartialEq> PartialEq for Rect<S>
[src]

[src]

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

[src]

This method tests for !=.