Skip to content

Rect

#include <Geometry.hpp>

Represents a rectangular region in 2D space.

Defines position (x, y) and size (width, height) of a rectangular area. Provides helper methods to calculate bounds.

ReturnNameDescription
intxX coordinate of top-left corner.
intyY coordinate of top-left corner.
intwidthWidth of rectangle.
intheightHeight of rectangle.

int x = 0

X coordinate of top-left corner.


int y = 0

Y coordinate of top-left corner.


int width = 0

Width of rectangle.


int height = 0

Height of rectangle.

ReturnNameDescription
intright const inlineReturns the X coordinate of the right edge (exclusive).
intbottom const inlineReturns the Y coordinate of the bottom edge (exclusive).

const inline

inline int right() const

Returns the X coordinate of the right edge (exclusive).

x + width


const inline

inline int bottom() const

Returns the Y coordinate of the bottom edge (exclusive).

y + height