ClanLib
2.3.7
|
Rounded rects drawing class. More...
#include <rounded_rect.h>
Public Member Functions | |
Construction | |
CL_RoundedRect (CL_Sizef size, float rounding_in_pixels=5.0f) | |
Constructs a RoundedRect. More... | |
virtual | ~CL_RoundedRect () |
Attributes | |
CL_Sizef | get_size () const |
Returns the base rectangle. More... | |
float | get_width () const |
Returns the width of the rectangle. More... | |
float | get_height () const |
Returns the height of the rectangle. More... | |
float | get_rounding () const |
Returns the distance from a corner (in pixels) at which the rounding starts. More... | |
CL_Pointf | get_control_point_tl () const |
Returns the positions of the top-left corners conic bezier control point. More... | |
CL_Pointf | get_control_point_tr () const |
Returns the positions of the top-right corners conic bezier control point. More... | |
CL_Pointf | get_control_point_bl () const |
Returns the positions of the bottom-left corners conic bezier control point. More... | |
CL_Pointf | get_control_point_br () const |
Returns the positions of the bottom-right corners conic bezier control point. More... | |
CL_Sizef | get_rounding_top_left () const |
Returns the relative offset (0.0-1.0) to the center of the edges connected to the corner. More... | |
CL_Sizef | get_rounding_top_right () const |
Returns the relative offset (0.0-1.0) to the center of the edges connected to the corner. More... | |
CL_Sizef | get_rounding_bottom_left () const |
Returns the relative offset (0.0-1.0) to the center of the edges connected to the corner. More... | |
CL_Sizef | get_rounding_bottom_right () const |
Returns the relative offset (0.0-1.0) to the center of the edges connected to the corner. More... | |
Operations | |
void | draw (CL_GraphicContext &gc, const CL_Pointf &position, const CL_Colorf &color, CL_Origin origin=origin_top_left) |
Draw the rectangle outline. More... | |
void | fill (CL_GraphicContext &gc, const CL_Pointf &position, const CL_Colorf &color, CL_Origin origin=origin_top_left) |
Fill the rectangle. More... | |
void | fill (CL_GraphicContext &gc, const CL_Pointf &position, const CL_Gradient &gradient, CL_Origin origin=origin_top_left) |
void | set_size (const CL_Sizef &size) |
Set the size of the base rectangle. More... | |
void | set_control_point_tl (const CL_Pointf &pos) |
Set the position of the top-left corners conic bezier control point. More... | |
void | set_control_point_tr (const CL_Pointf &pos) |
Set the positions of the top-right corners conic bezier control point. More... | |
void | set_control_point_bl (const CL_Pointf &pos) |
Set the positions of the bottom-left corners conic bezier control point. More... | |
void | set_control_point_br (const CL_Pointf &pos) |
Set the positions of the bottom-right corners conic bezier control point. More... | |
void | set_rounding (float offset_pixels) |
Set the distance from a corner (in pixels) at which the rounding starts. More... | |
void | set_rounding_top_left (const CL_Sizef &offset) |
Set the relative offset (0.0-1.0) to the center of the edges connected to the corner. More... | |
void | set_rounding_top_right (const CL_Sizef &offset) |
Set the relative offset (0.0-1.0) to the center of the edges connected to the corner. More... | |
void | set_rounding_bottom_left (const CL_Sizef &offset) |
Set the relative offset (0.0-1.0) to the center of the edges connected to the corner. More... | |
void | set_rounding_bottom_right (const CL_Sizef &offset) |
Set the relative offset (0.0-1.0) to the center of the edges connected to the corner. More... | |
Rounded rects drawing class.
CL_RoundedRect::CL_RoundedRect | ( | CL_Sizef | size, |
float | rounding_in_pixels = 5.0f |
||
) |
Constructs a RoundedRect.
size | = Sizef |
rounding_in_pixels | = value |
|
virtual |
void CL_RoundedRect::draw | ( | CL_GraphicContext & | gc, |
const CL_Pointf & | position, | ||
const CL_Colorf & | color, | ||
CL_Origin | origin = origin_top_left |
||
) |
Draw the rectangle outline.
void CL_RoundedRect::fill | ( | CL_GraphicContext & | gc, |
const CL_Pointf & | position, | ||
const CL_Colorf & | color, | ||
CL_Origin | origin = origin_top_left |
||
) |
Fill the rectangle.
void CL_RoundedRect::fill | ( | CL_GraphicContext & | gc, |
const CL_Pointf & | position, | ||
const CL_Gradient & | gradient, | ||
CL_Origin | origin = origin_top_left |
||
) |
CL_Pointf CL_RoundedRect::get_control_point_bl | ( | ) | const |
Returns the positions of the bottom-left corners conic bezier control point.
CL_Pointf CL_RoundedRect::get_control_point_br | ( | ) | const |
Returns the positions of the bottom-right corners conic bezier control point.
CL_Pointf CL_RoundedRect::get_control_point_tl | ( | ) | const |
Returns the positions of the top-left corners conic bezier control point.
CL_Pointf CL_RoundedRect::get_control_point_tr | ( | ) | const |
Returns the positions of the top-right corners conic bezier control point.
float CL_RoundedRect::get_height | ( | ) | const |
Returns the height of the rectangle.
float CL_RoundedRect::get_rounding | ( | ) | const |
Returns the distance from a corner (in pixels) at which the rounding starts.
This value is used for corners for which no value has been specified separately.
CL_Sizef CL_RoundedRect::get_rounding_bottom_left | ( | ) | const |
Returns the relative offset (0.0-1.0) to the center of the edges connected to the corner.
CL_Sizef CL_RoundedRect::get_rounding_bottom_right | ( | ) | const |
Returns the relative offset (0.0-1.0) to the center of the edges connected to the corner.
CL_Sizef CL_RoundedRect::get_rounding_top_left | ( | ) | const |
Returns the relative offset (0.0-1.0) to the center of the edges connected to the corner.
CL_Sizef CL_RoundedRect::get_rounding_top_right | ( | ) | const |
Returns the relative offset (0.0-1.0) to the center of the edges connected to the corner.
CL_Sizef CL_RoundedRect::get_size | ( | ) | const |
Returns the base rectangle.
float CL_RoundedRect::get_width | ( | ) | const |
Returns the width of the rectangle.
void CL_RoundedRect::set_control_point_bl | ( | const CL_Pointf & | pos) |
Set the positions of the bottom-left corners conic bezier control point.
void CL_RoundedRect::set_control_point_br | ( | const CL_Pointf & | pos) |
Set the positions of the bottom-right corners conic bezier control point.
void CL_RoundedRect::set_control_point_tl | ( | const CL_Pointf & | pos) |
Set the position of the top-left corners conic bezier control point.
void CL_RoundedRect::set_control_point_tr | ( | const CL_Pointf & | pos) |
Set the positions of the top-right corners conic bezier control point.
void CL_RoundedRect::set_rounding | ( | float | offset_pixels) |
Set the distance from a corner (in pixels) at which the rounding starts.
This value is used for corners for which no value has been specified separately.
void CL_RoundedRect::set_rounding_bottom_left | ( | const CL_Sizef & | offset) |
Set the relative offset (0.0-1.0) to the center of the edges connected to the corner.
void CL_RoundedRect::set_rounding_bottom_right | ( | const CL_Sizef & | offset) |
Set the relative offset (0.0-1.0) to the center of the edges connected to the corner.
void CL_RoundedRect::set_rounding_top_left | ( | const CL_Sizef & | offset) |
Set the relative offset (0.0-1.0) to the center of the edges connected to the corner.
void CL_RoundedRect::set_rounding_top_right | ( | const CL_Sizef & | offset) |
Set the relative offset (0.0-1.0) to the center of the edges connected to the corner.
void CL_RoundedRect::set_size | ( | const CL_Sizef & | size) |
Set the size of the base rectangle.