Ritchie's Abstractions 0.2
Platform abstractions that make Toolbox work
Loading...
Searching...
No Matches
Rectangle Struct Reference

Structure representing a 2D axis-aligned bounding rectangle. More...

Inheritance diagram for Rectangle:

Public Member Functions

 Rectangle (int x, int y, int width, int height)
 Creates a new rectangle.
 
override bool Equals ([NotNullWhen(true)] object? obj)
 
override int GetHashCode ()
 
override string ToString ()
 
bool Equals (Rectangle other)
 

Static Public Member Functions

static bool operator== (Rectangle a, Rectangle b)
 Checks if two rectangles are equal.
 
static bool operator!= (Rectangle a, Rectangle b)
 Checks if two rectangles are not equal.
 

Public Attributes

int X
 The horizontal position of the rectangle.
 
int Y
 The vertical position of the rectangle.
 
int Width
 The width of the rectangle.
 
int Height
 The height of the rectangle.
 

Properties

int Left [get]
 Gets the position of the left edge of the rectangle.
 
int Top [get]
 Gets the position of the top edge of the rectangle.
 
int Right [get]
 Gets the position of the right edge of the rectangle.
 
int Bottom [get]
 Gets the position of the bottom edge of the rectangle.
 
Point TopLeft [get]
 Gets the top-left position of the rectangle.
 
Point Size [get]
 Gets the absolute size of the rectangle.
 

Detailed Description

Structure representing a 2D axis-aligned bounding rectangle.

Constructor & Destructor Documentation

◆ Rectangle()

Rectangle ( int x,
int y,
int width,
int height )
inline

Creates a new rectangle.

Parameters
xThe horizontal position of the rectangle.
yThe vertical position of the rectangle.
widthThe width of the rectangle.
heightThe height of the rectangle.

Member Function Documentation

◆ operator!=()

static bool operator!= ( Rectangle a,
Rectangle b )
inlinestatic

Checks if two rectangles are not equal.

Parameters
aLeft side of the operation
bRight side of the operation
Returns
False if the rectangles are equal, true otherwise.

◆ operator==()

static bool operator== ( Rectangle a,
Rectangle b )
inlinestatic

Checks if two rectangles are equal.

Parameters
aLeft side of the operation
bRight side of the operation
Returns
True if the rectangles are equal, false otherwise.

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