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

#include <canvas.h>

Collaboration diagram for novasvg::Rect:

Public Member Functions

constexpr Rect ()=default
 
constexpr Rect (const Size &size)
 
constexpr Rect (float width, float height)
 
constexpr Rect (const Point &origin, const Size &size)
 
constexpr Rect (const rect_t &rect)
 
constexpr Rect (float x, float y, float w, float h)
 
 Rect (const Box &box)
 
constexpr void move (float dx, float dy)
 
constexpr void move (float d)
 
constexpr void move (const Point &p)
 
constexpr void scale (float sx, float sy)
 
constexpr void scale (float s)
 
constexpr void inflate (float dx, float dy)
 
constexpr void inflate (float d)
 
constexpr bool contains (float px, float py) const
 
constexpr bool contains (const Point &p) const
 
constexpr Rect intersected (const Rect &rect) const
 
constexpr Rect united (const Rect &rect) const
 
constexpr Rect & intersect (const Rect &o)
 
constexpr Rect & unite (const Rect &o)
 
constexpr Point origin () const
 
constexpr Size size () const
 
constexpr float right () const
 
constexpr float bottom () const
 
constexpr bool isEmpty () const
 
constexpr bool isZero () const
 
constexpr bool isValid () const
 

Public Attributes

float x {0}
 
float y {0}
 
float w {0}
 
float h {0}
 

Static Public Attributes

static const Rect Empty
 
static const Rect Invalid
 
static const Rect Infinite
 

Detailed Description

Definition at line 163 of file canvas.h.

Constructor & Destructor Documentation

◆ Rect() [1/7]

constexpr novasvg::Rect::Rect ( )
constexprdefault

Referenced by intersected(), and united().

◆ Rect() [2/7]

constexpr novasvg::Rect::Rect ( const Size &  size)
inlineexplicitconstexpr

Definition at line 166 of file canvas.h.

◆ Rect() [3/7]

constexpr novasvg::Rect::Rect ( float  width,
float  height 
)
inlineconstexpr

Definition at line 167 of file canvas.h.

◆ Rect() [4/7]

constexpr novasvg::Rect::Rect ( const Point &  origin,
const Size &  size 
)
inlineconstexpr

Definition at line 168 of file canvas.h.

◆ Rect() [5/7]

constexpr novasvg::Rect::Rect ( const rect_t &  rect)
inlineconstexpr

Definition at line 169 of file canvas.h.

◆ Rect() [6/7]

constexpr novasvg::Rect::Rect ( float  x,
float  y,
float  w,
float  h 
)
inlineconstexpr

Definition at line 170 of file canvas.h.

◆ Rect() [7/7]

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

Definition at line 743 of file novasvg.h.

Member Function Documentation

◆ bottom()

constexpr float novasvg::Rect::bottom ( ) const
inlineconstexpr

Definition at line 197 of file canvas.h.

References h, and y.

◆ contains() [1/2]

constexpr bool novasvg::Rect::contains ( const Point &  p) const
inlineconstexpr

Definition at line 185 of file canvas.h.

References contains(), novasvg::Point::x, and novasvg::Point::y.

Referenced by contains().

◆ contains() [2/2]

constexpr bool novasvg::Rect::contains ( float  px,
float  py 
) const
inlineconstexpr

Definition at line 184 of file canvas.h.

References h, x, and y.

◆ inflate() [1/2]

constexpr void novasvg::Rect::inflate ( float  d)
inlineconstexpr

Definition at line 182 of file canvas.h.

References inflate().

Referenced by inflate().

◆ inflate() [2/2]

constexpr void novasvg::Rect::inflate ( float  dx,
float  dy 
)
inlineconstexpr

Definition at line 181 of file canvas.h.

References h, w, x, and y.

Referenced by novasvg::SVGRenderState::beginGroup(), and novasvg::SVGGeometryElement::strokeBoundingBox().

◆ intersect()

constexpr Rect & novasvg::Rect::intersect ( const Rect &  o)
constexpr

Definition at line 242 of file canvas.h.

References intersected().

Referenced by novasvg::SVGElement::paintBoundingBox().

◆ intersected()

constexpr Rect novasvg::Rect::intersected ( const Rect &  rect) const
constexpr

◆ isEmpty()

constexpr bool novasvg::Rect::isEmpty ( ) const
inlineconstexpr

◆ isValid()

constexpr bool novasvg::Rect::isValid ( ) const
inlineconstexpr

◆ isZero()

constexpr bool novasvg::Rect::isZero ( ) const
inlineconstexpr

Definition at line 200 of file canvas.h.

References h, and w.

◆ move() [1/3]

constexpr void novasvg::Rect::move ( const Point &  p)
inlineconstexpr

Definition at line 176 of file canvas.h.

References move(), novasvg::Point::x, and novasvg::Point::y.

Referenced by move().

◆ move() [2/3]

constexpr void novasvg::Rect::move ( float  d)
inlineconstexpr

Definition at line 175 of file canvas.h.

References move().

Referenced by move().

◆ move() [3/3]

constexpr void novasvg::Rect::move ( float  dx,
float  dy 
)
inlineconstexpr

Definition at line 174 of file canvas.h.

References x, and y.

◆ origin()

constexpr Point novasvg::Rect::origin ( ) const
inlineconstexpr

Definition at line 193 of file canvas.h.

References x, and y.

◆ right()

constexpr float novasvg::Rect::right ( ) const
inlineconstexpr

Definition at line 196 of file canvas.h.

References w, and x.

◆ scale() [1/2]

constexpr void novasvg::Rect::scale ( float  s)
inlineconstexpr

Definition at line 179 of file canvas.h.

References scale().

Referenced by scale().

◆ scale() [2/2]

constexpr void novasvg::Rect::scale ( float  sx,
float  sy 
)
inlineconstexpr

Definition at line 178 of file canvas.h.

References h, w, x, and y.

◆ size()

constexpr Size novasvg::Rect::size ( ) const
inlineconstexpr

Definition at line 194 of file canvas.h.

References h, and w.

Referenced by novasvg::SVGElement::currentViewportSize(), and novasvg::SVGPreserveAspectRatio::transformRect().

◆ unite()

constexpr Rect & novasvg::Rect::unite ( const Rect &  o)
constexpr

◆ united()

constexpr Rect novasvg::Rect::united ( const Rect &  rect) const
constexpr

Member Data Documentation

◆ Empty

◆ h

◆ Infinite

NOVASVG_INLINE const Rect novasvg::Rect::Infinite
static

Definition at line 205 of file canvas.h.

◆ Invalid

◆ w

◆ x

◆ y


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