Struct nannou_core::geom::rect::Rect [−][src]
Expand description
Defines a Rectangle’s bounds across the x and y axes.
Fields
x: Range<S>
The start and end positions of the Rectangle on the x axis.
y: Range<S>
The start and end positions of the Rectangle on the y axis.
Implementations
Construct a Rect from the given x
y
coordinates and w
h
dimensions.
The Rect’s centered coordinates and dimensions in a tuple.
Align self
to other
along the x axis in accordance with the given Align
variant.
Align self
to other
along the y axis in accordance with the given Align
variant.
Align the middle of self
with the middle of the other
Rect along the x axis.
Align the middle of self
with the middle of the other
Rect along the y axis.
Place self
in the middle of the top edge of the other
Rect.
Place self
in the middle of the bottom edge of the other
Rect.
Place self
in the middle of the left edge of the other
Rect.
Place self
in the middle of the right edge of the other
Rect.
Place self
directly in the middle of the other
Rect.
The four ranges used for the Rect
’s four subdivisions.
Divide the Rect
in half along the x and y axes and return the four subdivisions.
Subdivisions are yielded in the following order:
- Bottom left
- Bottom right
- Top left
- Top right
pub fn subdivisions_iter(&self) -> Subdivisions<S>ⓘNotable traits for Subdivisions<S>impl<S> Iterator for Subdivisions<S> where
S: Copy, type Item = Rect<S>;
pub fn subdivisions_iter(&self) -> Subdivisions<S>ⓘNotable traits for Subdivisions<S>impl<S> Iterator for Subdivisions<S> where
S: Copy, type Item = Rect<S>;
impl<S> Iterator for Subdivisions<S> where
S: Copy, type Item = Rect<S>;
The same as subdivisions
but each subdivision is yielded via the returned Iterator
.
Construct a Rect from the coordinates of two points.
Converts self
to an absolute Rect
so that the magnitude of each range is always
positive.
The Rect representing the area in which two Rects overlap.
The Rect that encompass the two given sets of Rect.
The edges of the Rect in a tuple (left, right, bottom, top).
Align self
’s right edge with the left edge of the other
Rect.
Align self
’s left edge with the right dge of the other
Rect.
Align self
’s top edge with the bottom edge of the other
Rect.
Align self
’s bottom edge with the top edge of the other
Rect.
Align self
’s left edge with the left edge of the other
Rect.
Align self
’s right edge with the right edge of the other
Rect.
Align self
’s bottom edge with the bottom edge of the other
Rect.
Align self
’s top edge with the top edge of the other
Rect.
Place self
along the top left edges of the other
Rect.
Place self
along the top right edges of the other
Rect.
Place self
along the bottom left edges of the other
Rect.
Place self
along the bottom right edges of the other
Rect.
Does the given point touch the Rectangle.
Stretches the closest edge(s) to the given point if the point lies outside of the Rect area.
Return the Corner of self
that is closest to the given Point.
An iterator yielding the four corners of the Rect
.
An iterator yielding the Rect
’s two Tri
’s.
Construct a Rect from a given Point
and Dimensions
.
Construct a Rect from the coordinates of two points.
The bottom left corner Point.
The bottom right corner Point.
The middle of the bottom edge.
Stretches the closest edge(s) to the given point if the point lies outside of the Rect area.
Construct a Rect from a given Point
and Dimensions
.
Construct a Rect at origin with the given dimensions.
Construct a Rect from the coordinates of two points.
The bottom left corner Point.
The bottom right corner Point.
The middle of the bottom edge.
Stretches the closest edge(s) to the given point if the point lies outside of the Rect area.
The left and top edges of the Rect along with the width and height.
The left and bottom edges of the Rect along with the width and height.
The rect with some padding applied to the bottom edge.
Returns a Rect
with a position relative to the given position on the x axis.
Returns a Rect
with a position relative to the given position on the y axis.
Returns a Rect
with a position relative to the given position.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<S> RefUnwindSafe for Rect<S> where
S: RefUnwindSafe,
impl<S> UnwindSafe for Rect<S> where
S: UnwindSafe,
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: Component + Float,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: Component + Float,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
Mutably borrows from an owned value. Read more
Convert into T with values clamped to the color defined bounds Read more
Convert into T. The resulting color might be invalid in its color space Read more
Convert into T, returning ok if the color is inside of its defined range,
otherwise an OutOfBounds
error is returned which contains the unclamped color. Read more