|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Asks that drawing be cut to the entity's rectangle, and holds the rectangle that results. More...
#include <headers/guillaume/components/clip.hpp>


Classes | |
| struct | Rect |
| The clip rectangle, in the same coordinates as the position of a components::Transform. More... | |
Public Member Functions | |
| Clip (void)=default | |
| Default constructor for the Clip component. | |
| ~Clip (void)=default | |
| Default destructor for the Clip component. | |
| float | getMargin (void) const |
| Get the inset between the bound and the clip rectangle. | |
| Clip & | setMargin (float margin) |
| Set the inset between the bound and the clip rectangle. | |
| bool | isEnabled (void) const |
| Check whether systems::Clip processes this entity. | |
| Clip & | setEnabled (bool enabled) |
| Turn clipping on or off without removing the component. | |
| const Rect & | getRect (void) const |
| Get the rectangle computed by systems::Clip. | |
| Clip & | setRect (const Rect &rect) |
| Store the computed rectangle. Called by systems::Clip; a value set by hand is replaced on the next frame. | |
| Public Member Functions inherited from guillaume::ecs::Component | |
| bool | hasChanged (void) const |
| Tell whether a value of the component changed since the flags were last reset (the end of the previous frame). | |
| void | setHasChanged (bool hasChanged) |
| Raise or lower the changed flag. | |
| Component (void)=default | |
| Create a component that is not marked as changed. | |
| virtual | ~Component (void)=default |
| Virtual destructor, so components can be destroyed through the base class. | |
Asks that drawing be cut to the entity's rectangle, and holds the rectangle that results.
The application or a widget sets the margin and the enabled flag. systems::Clip (Layout phase) reads them with the entity's Transform and Bound, computes the rectangle (the bound shrunk by the margin on every side), stores it with setRect() and gives it to the engine as the scissor rectangle.
| float guillaume::components::Clip::getMargin | ( | void | ) | const |
| const Clip::Rect & guillaume::components::Clip::getRect | ( | void | ) | const |
Get the rectangle computed by systems::Clip.
| bool guillaume::components::Clip::isEnabled | ( | void | ) | const |
Check whether systems::Clip processes this entity.
| Clip & guillaume::components::Clip::setEnabled | ( | bool | enabled | ) |
Turn clipping on or off without removing the component.
Marks the component changed only when the value differs.
| enabled | False to make systems::Clip skip this entity. |
Definition at line 47 of file clip.cpp.

| Clip & guillaume::components::Clip::setMargin | ( | float | margin | ) |
Set the inset between the bound and the clip rectangle.
Marks the component changed only when the value differs.
| margin | The margin, in dp, removed on every side. A negative value makes the rectangle larger than the bound. |
Definition at line 32 of file clip.cpp.

Store the computed rectangle. Called by systems::Clip; a value set by hand is replaced on the next frame.
Marks the component changed only when the rectangle differs.
| rect | The clip rectangle, in dp. |
Definition at line 62 of file clip.cpp.
