Nana C++ Library. Reference for users.
What we need to use nana
|
Public Member Functions | |
rectangle () | |
a zero-size rectangle at (0, 0). More... | |
rectangle (int x, int y, unsigned width, unsigned height) | |
rectangle (const size &) | |
a rectangle with specified size at coordinate (0, 0). More... | |
rectangle (const point &, const size &=size()) | |
bool | operator== (const rectangle &rhs) const |
bool | operator!= (const rectangle &rhs) const |
point | position () const noexcept |
rectangle & | position (const point &) noexcept |
size | dimension () const noexcept |
rectangle & | dimension (const size &) noexcept |
rectangle & | pare_off (int pixels) |
Pares the specified pixels off the rectangle. More... | |
int | right () const noexcept |
int | bottom () const noexcept |
bool | is_hit (int x, int y) const |
bool | is_hit (const point &pos) const |
bool | empty () const |
true if width * height == 0. More... | |
rectangle & | shift () |
Swap position x and y, size width and height. More... | |
Public Attributes | |
int | x |
int | y |
unsigned | width |
unsigned | height |
nana::rectangle::rectangle | ( | ) |
a zero-size rectangle at (0, 0).
nana::rectangle::rectangle | ( | int | x, |
int | y, | ||
unsigned | width, | ||
unsigned | height | ||
) |
|
explicit |
a rectangle with specified size at coordinate (0, 0).
|
noexcept |
|
noexcept |
bool nana::rectangle::empty | ( | ) | const |
true if width * height == 0.
bool nana::rectangle::is_hit | ( | int | x, |
int | y | ||
) | const |
bool nana::rectangle::is_hit | ( | const point & | pos | ) | const |
bool nana::rectangle::operator!= | ( | const rectangle & | rhs | ) | const |
bool nana::rectangle::operator== | ( | const rectangle & | rhs | ) | const |
rectangle & nana::rectangle::pare_off | ( | int | pixels | ) |
Pares the specified pixels off the rectangle.
It's equal to x += pixels; y + pixels; width -= (pixels << 1); height -= (pixels << 1);
pixels | The number of pixels to be pared. If the number that multiples pixels twice is larger than width/height, the width/height will be zero. If the pixels is a negative number, the width/height is add the number that multiple pixels twice. |
|
noexcept |
|
noexcept |
rectangle & nana::rectangle::shift | ( | ) |
Swap position x and y, size width and height.
unsigned nana::rectangle::height |
unsigned nana::rectangle::width |
int nana::rectangle::x |
int nana::rectangle::y |