VectSharp 2.5.0
A light library for C# vector graphics
Loading...
Searching...
No Matches
VectSharp.Rectangle Struct Reference

Represents a rectangle. More...

Public Member Functions

bool IsNaN ()
 Checks whether the rectangle is equivalent to Rectangle.NaN. More...
 
 Rectangle (Point location, Size size)
 Create a new Rectangle given its top-left corner and its size. More...
 
 Rectangle (double x, double y, double width, double height)
 Create a new Rectangle given its top-left corner and its size. More...
 
 Rectangle (Point topLeft, Point bottomRight)
 Create a new Rectangle given its top-left corner and its bottom-right corner. More...
 

Static Public Member Functions

static Rectangle Union (Rectangle rectangle1, Rectangle rectangle2)
 Computes the rectangular bounds of the union of two Rectangles. More...
 
static Rectangle Intersection (Rectangle rectangle1, Rectangle rectangle2)
 Computes the intersection of two Rectangles. More...
 
static Rectangle Union (IEnumerable< Rectangle > rectangles)
 Computes the rectangular bounds of the union of multiple Rectangles. More...
 
static Rectangle Union (params Rectangle[] rectangles)
 Computes the rectangular bounds of the union of multiple Rectangles. More...
 

Public Attributes

Point Location
 The top-left corner of the rectangle. More...
 
Size Size
 The size of the rectangle. More...
 

Static Public Attributes

static readonly Rectangle NaN = new Rectangle(double.NaN, double.NaN, double.NaN, double.NaN)
 A rectangle whose dimensions are all double.NaN. More...
 

Properties

Point Centre [get]
 The centre of the rectangle. More...
 

Detailed Description

Represents a rectangle.

Definition at line 295 of file Point.cs.

Constructor & Destructor Documentation

◆ Rectangle() [1/3]

VectSharp.Rectangle.Rectangle ( Point  location,
Size  size 
)

Create a new Rectangle given its top-left corner and its size.

Parameters
locationThe top-left corner of the rectangle.
sizeThe size of the rectangle.

Definition at line 331 of file Point.cs.

◆ Rectangle() [2/3]

VectSharp.Rectangle.Rectangle ( double  x,
double  y,
double  width,
double  height 
)

Create a new Rectangle given its top-left corner and its size.

Parameters
xThe horizontal coordinate of the top-left corner of the rectangle.
yThe vertical coordinate of the top-left corner of the rectangle.
widthThe width of the rectangle.
heightThe height of the rectangle.

Definition at line 344 of file Point.cs.

◆ Rectangle() [3/3]

VectSharp.Rectangle.Rectangle ( Point  topLeft,
Point  bottomRight 
)

Create a new Rectangle given its top-left corner and its bottom-right corner.

Parameters
topLeftThe top-left corner of the rectangle.
bottomRightThe bottom-right corner of the rectangle.

Definition at line 355 of file Point.cs.

Member Function Documentation

◆ Intersection()

static Rectangle VectSharp.Rectangle.Intersection ( Rectangle  rectangle1,
Rectangle  rectangle2 
)
static

Computes the intersection of two Rectangles.

Parameters
rectangle1The first Rectangle.
rectangle2The second Rectangle.
Returns
The rectangle corresponding to the intersection of rectangle1 and rectangle2 , or Rectangle.NaN if the intersection is empty.

Definition at line 400 of file Point.cs.

◆ IsNaN()

bool VectSharp.Rectangle.IsNaN ( )

Checks whether the rectangle is equivalent to Rectangle.NaN.

Returns
true if all the dimensions of the rectangle are double.NaN, false otherwise.

Definition at line 306 of file Point.cs.

◆ Union() [1/3]

static Rectangle VectSharp.Rectangle.Union ( IEnumerable< Rectangle rectangles)
static

Computes the rectangular bounds of the union of multiple Rectangles.

Parameters
rectanglesThe Rectangles whose union will be computed.
Returns
The smallest Rectangle containing all the rectangles .

Definition at line 424 of file Point.cs.

◆ Union() [2/3]

static Rectangle VectSharp.Rectangle.Union ( params Rectangle[]  rectangles)
static

Computes the rectangular bounds of the union of multiple Rectangles.

Parameters
rectanglesThe Rectangles whose union will be computed.
Returns
The smallest Rectangle containing all the rectangles .

Definition at line 457 of file Point.cs.

◆ Union() [3/3]

static Rectangle VectSharp.Rectangle.Union ( Rectangle  rectangle1,
Rectangle  rectangle2 
)
static

Computes the rectangular bounds of the union of two Rectangles.

Parameters
rectangle1The first Rectangle.
rectangle2The second Rectangle.
Returns
The smallest Rectangle containing both rectangle1 and rectangle2 .

Definition at line 367 of file Point.cs.

Member Data Documentation

◆ Location

Point VectSharp.Rectangle.Location

The top-left corner of the rectangle.

Definition at line 314 of file Point.cs.

◆ NaN

readonly Rectangle VectSharp.Rectangle.NaN = new Rectangle(double.NaN, double.NaN, double.NaN, double.NaN)
static

A rectangle whose dimensions are all double.NaN.

Definition at line 300 of file Point.cs.

◆ Size

Size VectSharp.Rectangle.Size

The size of the rectangle.

Definition at line 319 of file Point.cs.

Property Documentation

◆ Centre

Point VectSharp.Rectangle.Centre
get

The centre of the rectangle.

Definition at line 324 of file Point.cs.


The documentation for this struct was generated from the following file: