NovaSVG 0.10.0
A header-only SVG library
Loading...
Searching...
No Matches
novasvg::Box Class Reference

Represents a 2D axis-aligned bounding box. More...

#include <novasvg.h>

Public Member Functions

 Box ()=default
 Constructs a box with zero dimensions.
 
 Box (float x, float y, float w, float h)
 Constructs a box with the specified position and size.
 
 Box (const Rect &rect)
 
Box & transform (const Matrix &matrix)
 Transforms the box using the specified matrix.
 
Box transformed (const Matrix &matrix) const
 Returns a new box transformed by the specified matrix.
 

Public Attributes

float x {0}
 The x-coordinate of the box's origin.
 
float y {0}
 The y-coordinate of the box's origin.
 
float w {0}
 The width of the box.
 
float h {0}
 The height of the box.
 

Detailed Description

Represents a 2D axis-aligned bounding box.

Definition at line 170 of file novasvg.h.

Constructor & Destructor Documentation

◆ Box() [1/3]

novasvg::Box::Box ( )
default

Constructs a box with zero dimensions.

◆ Box() [2/3]

novasvg::Box::Box ( float  x,
float  y,
float  w,
float  h 
)
inline

Constructs a box with the specified position and size.

Parameters
xThe x-coordinate of the box's origin.
yThe y-coordinate of the box's origin.
wThe width of the box.
hThe height of the box.

Definition at line 722 of file novasvg.h.

◆ Box() [3/3]

novasvg::Box::Box ( const Rect &  rect)
inline

Definition at line 727 of file novasvg.h.

Member Function Documentation

◆ transform()

Box & novasvg::Box::transform ( const Matrix &  matrix)
inline

Transforms the box using the specified matrix.

Parameters
matrixThe transformation matrix.
Returns
A reference to this box, modified by the transformation.

Definition at line 732 of file novasvg.h.

References transformed().

◆ transformed()

Box novasvg::Box::transformed ( const Matrix &  matrix) const
inline

Returns a new box transformed by the specified matrix.

Parameters
matrixThe transformation matrix.
Returns
A new box, transformed by the matrix.

Definition at line 738 of file novasvg.h.

References novasvg::Transform::mapRect().

Referenced by novasvg::Element::getGlobalBoundingBox(), novasvg::Element::getLocalBoundingBox(), and transform().

Member Data Documentation

◆ h

float novasvg::Box::h {0}

The height of the box.

Definition at line 208 of file novasvg.h.

◆ w

float novasvg::Box::w {0}

The width of the box.

Definition at line 207 of file novasvg.h.

◆ x

float novasvg::Box::x {0}

The x-coordinate of the box's origin.

Definition at line 205 of file novasvg.h.

◆ y

float novasvg::Box::y {0}

The y-coordinate of the box's origin.

Definition at line 206 of file novasvg.h.


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