Enhanced C#
Language of your choice: library documentation
|
Contains methods to manipulate rectangles. More...
Contains methods to manipulate rectangles.
Unfortunately, C# often can't infer the type parameters. Many of these methods must be called with explicit type parameters.
Static Public Member Functions | |
static bool | IsNormal< Rect, T > (this Rect r) |
static void | Normalize< Rect, T > (this Rect r) |
static Rect | Union< Rect, T > (this Rect a, Rect b) |
Computes the union of two normalized rectangles, i.e. a rectangle large enough to cover both original rectangles. More... | |
static Rect | Intersect< Rect, T > (this Rect a, Rect b) |
Computes the intersection of two normalized rectangles, i.e. the region covered by both original rectangles. More... | |
static bool | ExpandToInclude< Rect, Point, T > (this Rect a, Point b) |
Expands a rectangle's boundaries to include a given point. More... | |
static bool | ExpandToInclude< Rect, Point, T > (this Rect a, IEnumerable< Point > bs) |
Expands a rectangle's boundaries to include a series of points. More... | |
static bool | Contains< Rect, Point, T > (this Rect a, Point b) |
Determines whether a rectangle contains a given point. More... | |
static bool | Contains< Rect, T > (this Rect a, Rect b) |
Determines whether a rectangle fully contains another rectangle. More... | |
static bool | Overlaps< Rect, T > (this Rect a, Rect b) |
Determines whether a rectangle overlaps another rectangle. More... | |
static void | SetRect< Rect, T > (this Rect r, T x, T y, T width, T height) |
static void | SetRange< Rect, T > (this Rect r, T x1, T y1, T x2, T y2) |
|
inlinestatic |
Determines whether a rectangle contains a given point.
Returns false if the rectangle is not normalized.
Point | : | IPointReader<T> | |
Rect | : | IRectangleBase<T> | |
Rect | : | INewRectangle | |
Rect | : | Rect | |
Rect | : | T | |
T | : | IComparable<T> |
|
inlinestatic |
Determines whether a rectangle fully contains another rectangle.
May not work correctly if either of the rectangles is not normalized.
Rect | : | IRectangleBase<T> | |
Rect | : | INewRectangle | |
Rect | : | Rect | |
Rect | : | T | |
T | : | IComparable<T> |
|
inlinestatic |
Expands a rectangle's boundaries to include a given point.
Point | : | IPointReader<T> | |
Rect | : | IRectangleBase<T> | |
Rect | : | INewRectangle | |
Rect | : | Rect | |
Rect | : | T | |
T | : | IComparable<T> |
|
inlinestatic |
Expands a rectangle's boundaries to include a series of points.
Point | : | IPointReader<T> | |
Rect | : | IRectangleBase<T> | |
Rect | : | INewRectangle | |
Rect | : | Rect | |
Rect | : | T | |
T | : | IComparable<T> |
|
inlinestatic |
Computes the intersection of two normalized rectangles, i.e. the region covered by both original rectangles.
The results may be incorrect if one or both rectangles are not normalized. If the rectangles do not overlap, a non-normalized rectangle is returned.
Rect | : | IRectangleBase<T> | |
Rect | : | INewRectangle | |
Rect | : | Rect | |
Rect | : | T | |
T | : | IComparable<T> |
|
inlinestatic |
Determines whether a rectangle overlaps another rectangle.
May not work correctly if either of the rectangles is not normalized.
Rect | : | IRectangleBase<T> | |
Rect | : | INewRectangle | |
Rect | : | Rect | |
Rect | : | T | |
T | : | IComparable<T> |
|
inlinestatic |
Computes the union of two normalized rectangles, i.e. a rectangle large enough to cover both original rectangles.
The results may be incorrect if one or both rectangles are not normalized.
Rect | : | IRectangleBase<T> | |
Rect | : | INewRectangle | |
Rect | : | Rect | |
Rect | : | T | |
T | : | IComparable<T> |