Euphoria
eu::Rect Struct Reference

Public Member Functions

 Rect ()
bool operator== (const Rect &rhs)=delete
void extend (const Rect &o)
void translate (const v2 &v)
void inset (const Lrtb &lrtb)
void set_empty ()
bool contains_exclusive (const Rect &r) const
 does this contains the argument?
Rect with_inset (const Lrtb &lrtb) const
Rect with_translate (const v2 &v) const
Rect with_top_left_at (const v2 &p) const
Rect with_bottom_left_at (const v2 &p) const
Rect with_offset (const v2 &p) const
Rect with_scale (float hor, float vert) const
v2 get_bottom_left () const
v2 get_center_pos () const
v2 get_relative_center_pos () const
bool is_empty () const
bool is_valid () const
v2 get_size () const
R< float > get_range_y () const
R< float > get_range_x () const
v2 get_top_left () const
v2 get_top_right () const
v2 get_bottom_right () const
Rect cut_left (float amount, float h_spacing=0.0f)
Rect cut_right (float amount, float h_spacing=0.0f)
Rect cut_bottom (float amount, float v_spacing=0.0f)
Rect cut_top (float amount, float v_spacing=0.0f)
Rect cut (RectCut side, float amount, float spacing=0.0f)
Rect get_left (float amount) const
Rect get_right (float amount) const
Rect get_bottom (float amount) const
Rect get_top (float amount) const
Rect add_left (float amount) const
Rect add_right (float amount) const
Rect add_bottom (float amount) const
Rect add_top (float amount) const

Static Public Member Functions

static constexpr Rect from_left_right_bottom_top (float left_side, float right_side, float bottom_side, float top_side)
static Rect from_left_right_top_bottom (float left_side, float right_side, float top_side, float bottom_side)
static Rect from_bottom_left_size (const v2 &bl, const v2 &size)
static Rect from_top_left_size (const v2 &top_left, const v2 &size)
static Rect from_size (const v2 &size)
static Rect from_point (const v2 &point)
static Rect from_center_inside_other (const Rect &self, const Rect &other)
 centers the self rectangle inside the other rectangle
static Rect from_scaled (const Rect &self, float scale)
 scaled copy around rect center

Public Attributes

float left
float right
float top
float bottom

Detailed Description

Definition at line 26 of file rect.h.

Constructor & Destructor Documentation

◆ Rect()

eu::Rect::Rect ( )

Member Function Documentation

◆ add_bottom()

Rect eu::Rect::add_bottom ( float amount) const

◆ add_left()

Rect eu::Rect::add_left ( float amount) const

◆ add_right()

Rect eu::Rect::add_right ( float amount) const

◆ add_top()

Rect eu::Rect::add_top ( float amount) const

◆ contains_exclusive()

bool eu::Rect::contains_exclusive ( const Rect & r) const
nodiscard

does this contains the argument?

◆ cut()

Rect eu::Rect::cut ( RectCut side,
float amount,
float spacing = 0.0f )

◆ cut_bottom()

Rect eu::Rect::cut_bottom ( float amount,
float v_spacing = 0.0f )

◆ cut_left()

Rect eu::Rect::cut_left ( float amount,
float h_spacing = 0.0f )

◆ cut_right()

Rect eu::Rect::cut_right ( float amount,
float h_spacing = 0.0f )

◆ cut_top()

Rect eu::Rect::cut_top ( float amount,
float v_spacing = 0.0f )

◆ extend()

void eu::Rect::extend ( const Rect & o)

◆ from_bottom_left_size()

Rect eu::Rect::from_bottom_left_size ( const v2 & bl,
const v2 & size )
staticnodiscard

◆ from_center_inside_other()

Rect eu::Rect::from_center_inside_other ( const Rect & self,
const Rect & other )
staticnodiscard

centers the self rectangle inside the other rectangle

◆ from_left_right_bottom_top()

constexpr Rect eu::Rect::from_left_right_bottom_top ( float left_side,
float right_side,
float bottom_side,
float top_side )
inlinestaticnodiscardconstexpr

Definition at line 38 of file rect.h.

◆ from_left_right_top_bottom()

Rect eu::Rect::from_left_right_top_bottom ( float left_side,
float right_side,
float top_side,
float bottom_side )
staticnodiscard

◆ from_point()

Rect eu::Rect::from_point ( const v2 & point)
staticnodiscard

◆ from_scaled()

Rect eu::Rect::from_scaled ( const Rect & self,
float scale )
staticnodiscard

scaled copy around rect center

◆ from_size()

Rect eu::Rect::from_size ( const v2 & size)
staticnodiscard

◆ from_top_left_size()

Rect eu::Rect::from_top_left_size ( const v2 & top_left,
const v2 & size )
staticnodiscard

◆ get_bottom()

Rect eu::Rect::get_bottom ( float amount) const

◆ get_bottom_left()

v2 eu::Rect::get_bottom_left ( ) const
nodiscard

◆ get_bottom_right()

v2 eu::Rect::get_bottom_right ( ) const
nodiscard

◆ get_center_pos()

v2 eu::Rect::get_center_pos ( ) const
nodiscard

◆ get_left()

Rect eu::Rect::get_left ( float amount) const

◆ get_range_x()

R< float > eu::Rect::get_range_x ( ) const
nodiscard

◆ get_range_y()

R< float > eu::Rect::get_range_y ( ) const
nodiscard

◆ get_relative_center_pos()

v2 eu::Rect::get_relative_center_pos ( ) const
nodiscard

◆ get_right()

Rect eu::Rect::get_right ( float amount) const

◆ get_size()

v2 eu::Rect::get_size ( ) const
nodiscard

◆ get_top()

Rect eu::Rect::get_top ( float amount) const

◆ get_top_left()

v2 eu::Rect::get_top_left ( ) const
nodiscard

◆ get_top_right()

v2 eu::Rect::get_top_right ( ) const
nodiscard

◆ inset()

void eu::Rect::inset ( const Lrtb & lrtb)

◆ is_empty()

bool eu::Rect::is_empty ( ) const
nodiscard

◆ is_valid()

bool eu::Rect::is_valid ( ) const
nodiscard

◆ operator==()

bool eu::Rect::operator== ( const Rect & rhs)
delete

◆ set_empty()

void eu::Rect::set_empty ( )

◆ translate()

void eu::Rect::translate ( const v2 & v)

◆ with_bottom_left_at()

Rect eu::Rect::with_bottom_left_at ( const v2 & p) const
nodiscard

◆ with_inset()

Rect eu::Rect::with_inset ( const Lrtb & lrtb) const
nodiscard

◆ with_offset()

Rect eu::Rect::with_offset ( const v2 & p) const
nodiscard

◆ with_scale()

Rect eu::Rect::with_scale ( float hor,
float vert ) const
nodiscard

◆ with_top_left_at()

Rect eu::Rect::with_top_left_at ( const v2 & p) const
nodiscard

◆ with_translate()

Rect eu::Rect::with_translate ( const v2 & v) const
nodiscard

Member Data Documentation

◆ bottom

float eu::Rect::bottom

Definition at line 31 of file rect.h.

◆ left

float eu::Rect::left

Definition at line 28 of file rect.h.

◆ right

float eu::Rect::right

Definition at line 29 of file rect.h.

◆ top

float eu::Rect::top

Definition at line 30 of file rect.h.


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