![]() |
Louvre v2.18.1-1
C++ library for Wayland compositors
|
A rectangle with rounded corners. More...
#include <LRRect.h>
Public Member Functions | |
LRRect (const LRect &rect={ 0 }, Int32 radTL=0, Int32 radTR=0, Int32 radBR=0, Int32 radBL=0) noexcept | |
Constructs a rounded rectangle. | |
bool | isValid () const noexcept |
Checks if the rectangle is valid. | |
constexpr bool | operator== (const LRRect &other) const |
Compares two rounded rectangles for equality. | |
constexpr bool | operator!= (const LRRect &other) const |
Compares two rounded rectangles for inequality. | |
![]() | |
constexpr | LRectTemplate () noexcept |
Initializes the vector with (0,0,0,0). | |
constexpr | LRectTemplate (Int32 x, Int32 y, Int32 width, Int32 height) noexcept |
Initializes the vector with (x,y,width,height). | |
constexpr | LRectTemplate (const LPointTemplate< NA > &topLeft, const LPointTemplate< NB > &bottomRight) noexcept |
Initializes the vector with (topLeft.x(),topLeft.y(),bottomRight.x(),bottomRight.y()). | |
constexpr | LRectTemplate (Int32 topLeft, const LPointTemplate< N > &bottomRight) noexcept |
Initializes the vector with (topLeft.x(),topLeft.y(),bottomRight.x(),bottomRight.y()). | |
constexpr | LRectTemplate (const LPointTemplate< N > &topLeft, Int32 bottomRight) noexcept |
Initializes the vector with (topLeft.x(),topLeft.y(),bottomRight.x(),bottomRight.y()). | |
constexpr | LRectTemplate (Int32 all) noexcept |
Initializes the vector with (all,all,all,all). | |
constexpr | LRectTemplate (const LPointTemplate< N > &p) noexcept |
Initializes the vector with (p.x(),p.y(),p.x(),p.y()). | |
constexpr | LRectTemplate (const LRectTemplate< N > &r) noexcept |
Copy constructor. | |
constexpr Int32 | x () const noexcept |
First vector component. | |
constexpr Int32 | y () const noexcept |
Second vector component. | |
constexpr Int32 | w () const noexcept |
Third vector component. | |
constexpr Int32 | h () const noexcept |
Fourth vector component. | |
constexpr Int32 | width () const noexcept |
Third vector component. | |
constexpr Int32 | height () const noexcept |
Fourth vector component. | |
constexpr Int32 | area () const noexcept |
The multiplication of the third and fourth component (width*height) | |
constexpr bool | containsPoint (const LPointTemplate< N > &point, bool inclusive=true) const noexcept |
constexpr bool | intersects (const LRectTemplate< N > &rect, bool inclusive=true) const noexcept |
constexpr const LPointTemplate< Int32 > & | topLeft () const noexcept |
2D vector given by the (x,y) components of the rectangle | |
constexpr const LPointTemplate< Int32 > & | bottomRight () const noexcept |
2D vector given by the (w,h) components of the rectangle | |
constexpr const LPointTemplate< Int32 > & | TL () const noexcept |
2D vector given by the (x,y) components of the rectangle | |
constexpr const LPointTemplate< Int32 > & | BR () const noexcept |
2D vector given by the (w,h) components of the rectangle | |
constexpr const LPointTemplate< Int32 > & | pos () const noexcept |
2D vector given by the (x,y) components of the rectangle | |
constexpr const LPointTemplate< Int32 > & | size () const noexcept |
2D vector given by the (w,h) components of the rectangle | |
constexpr void | setX (Int32 x) noexcept |
Asigns the first component. | |
constexpr void | setY (Int32 y) noexcept |
Asigns the second component. | |
constexpr void | setW (Int32 width) noexcept |
Asigns the third component. | |
constexpr void | setH (Int32 height) noexcept |
Asigns the fourth component. | |
constexpr void | setWidth (Int32 width) noexcept |
Asigns the third component. | |
constexpr void | setHeight (Int32 height) noexcept |
Asigns the fourth component. | |
constexpr void | setTL (const LPointTemplate< Int32 > &p) noexcept |
Asigns the (x,y) components. | |
constexpr void | setBR (const LPointTemplate< Int32 > &p) noexcept |
Asigns the (w,h) components. | |
constexpr void | setTopLeft (const LPointTemplate< Int32 > &p) noexcept |
Asigns the (x,y) components. | |
constexpr void | setBottomRight (const LPointTemplate< Int32 > &p) noexcept |
Asigns the (w,h) components. | |
constexpr void | setPos (const LPointTemplate< Int32 > &p) noexcept |
Asigns the (x,y) components. | |
constexpr void | setSize (const LPointTemplate< Int32 > &p) noexcept |
Asigns the (w,h) components. | |
constexpr bool | clip (const LRectTemplate< N > &rect) noexcept |
Returns true if the resulting rectangle has an area of 0. | |
Public Attributes | |
Int32 | fRadTL |
Radius of the top-left corner. | |
Int32 | fRadTR |
Radius of the top-right corner. | |
Int32 | fRadBR |
Radius of the bottom-right corner. | |
Int32 | fRadBL |
Radius of the bottom-left corner. | |
A rectangle with rounded corners.
This class extends LRect by adding support for rounded corners.
|
inlinenoexcept |
Constructs a rounded rectangle.
rect | The base rectangle. |
radTL | Radius of the top-left corner. |
radTR | Radius of the top-right corner. |
radBR | Radius of the bottom-right corner. |
radBL | Radius of the bottom-left corner. |
|
inlinenoexcept |
Checks if the rectangle is valid.
A rectangle is valid if its width and height are non-negative, each corner radius is non-negative, and the sum of adjacent corner radii does not exceed the respective width or height.
Compares two rounded rectangles for equality.
other | The rectangle to compare with. |
true
if all properties match, false
otherwise. Compares two rounded rectangles for inequality.
other | The rectangle to compare with. |
true
if any property differs, false
otherwise. Int32 fRadTL |
Radius of the top-left corner.
Int32 fRadTR |
Radius of the top-right corner.
Int32 fRadBR |
Radius of the bottom-right corner.
Int32 fRadBL |
Radius of the bottom-left corner.