|
|
Donner 0.5.1
Embeddable browser-grade SVG2 engine
|
RAII session for a drag interaction with composited rendering. More...
#include "donner/svg/compositor/DragSession.h"
Public Member Functions | |
| ~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 | |
| DragSession & | operator= (DragSession &&other) noexcept |
| 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. | |
Static Public Member Functions | |
| static std::optional< DragSession > | begin (CompositorController &compositor, Entity target) |
| Begin a drag session by promoting the target 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:
|
static |
Begin a drag session by promoting the target entity.
| compositor | The compositor controller managing layers. |
| target | The entity to drag. |