Loading...
Searching...
No Matches
Rect

#include <Ultralight/Geometry.h>

Overview

Float Rectangle Helper.

Static Public Member Functions

static constexpr Rect MakeEmpty ()
 

Public Member Functions

float width () const
 
float height () const
 
float x () const
 
float y () const
 
float center_x () const
 
float center_y () const
 
Point origin () const
 
void SetEmpty ()
 
bool IsEmpty () const
 
bool IsValid () const
 
void Inset (float dx, float dy)
 
void Outset (float dx, float dy)
 
void Move (float dx, float dy)
 
float area () const
 
void Join (const Rect &rhs)
 
void Join (const Point &p)
 
bool Contains (const Point &p) const
 
bool Contains (const Rect &r) const
 
bool Intersects (const Rect &rhs) const
 
Rect Intersect (const Rect &other) const
 
vec4 ToVec4 ()
 

Public Attributes

float left
 
float top
 
float right
 
float bottom
 

Friends

bool operator== (const Rect &a, const Rect &b)
 
bool operator!= (const Rect &a, const Rect &b)
 

Member Function Documentation

◆ area()

float area ( ) const
inline

◆ center_x()

float center_x ( ) const
inline

◆ center_y()

float center_y ( ) const
inline

◆ Contains() [1/2]

bool Contains ( const Point & p) const
inline

◆ Contains() [2/2]

bool Contains ( const Rect & r) const
inline

◆ height()

float height ( ) const
inline

◆ Inset()

void Inset ( float dx,
float dy )
inline

◆ Intersect()

Rect Intersect ( const Rect & other) const
inline

◆ Intersects()

bool Intersects ( const Rect & rhs) const
inline

◆ IsEmpty()

bool IsEmpty ( ) const
inline

◆ IsValid()

bool IsValid ( ) const
inline

◆ Join() [1/2]

void Join ( const Point & p)
inline

◆ Join() [2/2]

void Join ( const Rect & rhs)
inline

◆ MakeEmpty()

static constexpr Rect MakeEmpty ( )
inlinestaticconstexpr

◆ Move()

void Move ( float dx,
float dy )
inline

◆ origin()

Point origin ( ) const
inline

◆ Outset()

void Outset ( float dx,
float dy )
inline

◆ SetEmpty()

void SetEmpty ( )
inline

◆ ToVec4()

vec4 ToVec4 ( )
inline

◆ width()

float width ( ) const
inline

◆ x()

float x ( ) const
inline

◆ y()

float y ( ) const
inline

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const Rect & a,
const Rect & b )
friend

◆ operator==

bool operator== ( const Rect & a,
const Rect & b )
friend

Member Data Documentation

◆ bottom

float bottom

◆ left

float left

◆ right

float right

◆ top

float top

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