SDOM - Simple SDL Document Object Model
A lightweight, extensible Document Object Model for SDL-based applications.
Loading...
Searching...
No Matches
SDOM::Bounds Struct Reference

Represents a rectangle's position and size in 2D space. More...

#include <SDOM.hpp>

Public Member Functions

float width () const
 Calculates the width of the bounds.
 
float height () const
 Calculates the height of the bounds.
 
bool operator== (const Bounds &other) const
 
bool operator!= (const Bounds &other) const
 

Public Attributes

float left = 0.0f
 Left edge coordinate.
 
float top = 0.0f
 Top edge coordinate.
 
float right = 0.0f
 Right edge coordinate.
 
float bottom = 0.0f
 Bottom edge coordinate.
 

Detailed Description

Represents a rectangle's position and size in 2D space.

Stores the coordinates of the left, top, right, and bottom edges. Provides utility methods for calculating width and height. Useful for layout, collision, and rendering calculations.

Member Function Documentation

◆ height()

float SDOM::Bounds::height ( ) const
inline

Calculates the height of the bounds.

Returns
Absolute height (bottom - top).

◆ operator!=()

bool SDOM::Bounds::operator!= ( const Bounds other) const
inline

◆ operator==()

bool SDOM::Bounds::operator== ( const Bounds other) const
inline

◆ width()

float SDOM::Bounds::width ( ) const
inline

Calculates the width of the bounds.

Returns
Absolute width (right - left).

Member Data Documentation

◆ bottom

SDOM::Bounds::bottom = 0.0f

Bottom edge coordinate.

Bottom edge coordinate.

◆ left

SDOM::Bounds::left = 0.0f

Left edge coordinate.

Left edge coordinate.

◆ right

SDOM::Bounds::right = 0.0f

Right edge coordinate.

Right edge coordinate.

◆ top

SDOM::Bounds::top = 0.0f

Top edge coordinate.

Top edge coordinate.


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