Struct broccoli::node::Rect [−][src]
Expand description
An axis aligned rectangle. Stored as two Ranges. It is a semi-closed rectangle. A point is considered inside the rectangle if it is in [start,end) for both x and y.
Fields
x: Range<T>
y: Range<T>
Implementations
Create a rectangle from a point and radius.
Returns each corner in this order: topleft topright bottomright bottomleft
Returns true if the point is contained in the the ranges of both axis.
If the point is outisde the rectangle, returns the squared distance from the closest corner of the rectangle. If the point is inside the rectangle, it will return None.
If the point is outisde the rectangle, returns the squared distance from a point to the furthest corner of the rectangle.
Subdivides the rectangle. No floating point calculations are done. Important to note that a point that was in the original rectangle, could actually be inside both subdivded rectangles. This is because the ranges are inclusive on both sides [start,end].
Returns true if the specified rect is inside of this rect.
Grow the rectangle to fit the specified rectangle by replacing values with the specified rectangle. No floating point computations.
Get an intersecting rectangle. No floating point calculations as the new rectangle is made up of values from this rectangle and the specified rectangle.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Rect<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Rect<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more