RAII session for a drag interaction with composited rendering.
More...
#include "donner/svg/compositor/DragSession.h"
|
|
| ~DragSession () |
| | Destructor. Demotes the target entity if the session is still active.
|
|
| DragSession (const DragSession &)=delete |
|
DragSession & | operator= (const DragSession &)=delete |
| | DragSession (DragSession &&other) noexcept |
| | Transfer ownership of an active drag promotion.
|
| DragSession & | operator= (DragSession &&other) noexcept |
| | End this session's promotion and take ownership of another's.
|
|
Entity | target () const |
| | Returns the target entity being dragged.
|
|
bool | isActive () const |
| | Returns true if this session is still active (entity is promoted).
|
|
void | end () |
| | Explicitly end the drag session, demoting the entity.
|
RAII session for a drag interaction with composited rendering.
Promotes the target entity on construction and demotes it on destruction, ensuring the compositor layer lifecycle is tied to the drag gesture. Callers mutate the entity's DOM transform directly during the drag; the compositor's fast path (renderFrame) picks up pure-translation deltas and reuses the cached bitmap without re-rasterizing.
Usage:
if (!drag) { return; }
compositor.renderFrame(viewport);
drag.reset();
compositor.renderFrame(viewport);
static std::optional< DragSession > begin(CompositorController &compositor, Entity target)
Begin a drag session by promoting the target entity.
◆ DragSession()
| donner::svg::compositor::DragSession::DragSession |
( |
DragSession && | other | ) |
|
|
noexcept |
Transfer ownership of an active drag promotion.
- Parameters
-
| other | Session whose promotion is transferred. |
◆ begin()
Begin a drag session by promoting the target entity.
- Parameters
-
| compositor | The compositor controller managing layers. |
| target | The entity to drag. |
- Returns
- A DragSession if promotion succeeded, or std::nullopt if the entity could not be promoted (invalid entity, layer limit reached, etc.).
◆ operator=()
| DragSession & donner::svg::compositor::DragSession::operator= |
( |
DragSession && | other | ) |
|
|
noexcept |
End this session's promotion and take ownership of another's.
- Parameters
-
| other | Session whose promotion is transferred. |
- Returns
- This session after the transfer.
The documentation for this class was generated from the following file: