Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::editor::ExperimentalDragPresentation Struct Reference

Tracks experimental drag-compositing presentation state across selection, drag, and release. More...

#include "donner/editor/ExperimentalDragPresentation.h"

Collaboration diagram for donner::editor::ExperimentalDragPresentation:
[legend]

Public Member Functions

bool shouldPrewarm (Entity selectedEntity, std::uint64_t currentVersion, const Vector2i &currentCanvasSize, bool dragActive) const
 Returns true when selection should trigger an async prewarm capture.
void noteCachedTextures (Entity entity, std::uint64_t version, const Vector2i &canvasSize)
 Mark cached composited textures as available for the given entity/version/canvas size.
void noteChromeRefreshCompleted (std::uint64_t refreshedVersion)
 Finish the settle handoff once overlay chrome and cached AABBs have refreshed to match the settled document version. Only then is it safe to drop the old drag offset.
void beginSettling (const std::optional< SelectTool::ActiveDragPreview > &preview, std::uint64_t targetVersion)
 Begin the post-release settling phase, keeping the last composited presentation alive.
void noteFullRenderLanded (std::uint64_t landedVersion)
 End settling once a fresh full render has landed. Also clears cached texture state so the display falls back to the just-uploaded flat texture instead of showing stale composited layers.
std::optional< SelectTool::ActiveDragPreviewpresentationPreview (const std::optional< SelectTool::ActiveDragPreview > &activePreview) const
 Returns the drag preview that should currently be displayed, if any.
bool shouldDisplayCompositedLayers (const std::optional< SelectTool::ActiveDragPreview > &activePreview) const
 Returns true if the UI should draw the composited drag presentation right now.
void clearSettlingIfSelectionChanged (Entity selectedEntity, bool dragActive)
 Drop stale settling state when the selected entity changes away from the drag target.

Public Attributes

bool hasCachedTextures = false
Entity cachedEntity = entt::null
std::uint64_t cachedVersion = 0
Vector2i cachedCanvasSize = Vector2i::Zero()
std::optional< SelectTool::ActiveDragPreviewsettlingPreview
bool waitingForFullRender = false
std::uint64_t settlingTargetVersion = 0
bool waitingForChromeRefresh = false
std::uint64_t chromeRefreshTargetVersion = 0

Detailed Description

Tracks experimental drag-compositing presentation state across selection, drag, and release.

Member Function Documentation

◆ clearSettlingIfSelectionChanged()

void donner::editor::ExperimentalDragPresentation::clearSettlingIfSelectionChanged ( Entity selectedEntity,
bool dragActive )
inline

Drop stale settling state when the selected entity changes away from the drag target.

After ReplaceDocument, entity handles are invalidated and the selection is remapped to new entities. This detects the mismatch and clears the settling preview. However, the cached composited textures are deliberately kept alive: at zero composition offset they are visually identical to the flat texture, so keeping them avoids a visible pop during the settling → prewarm transition. The prewarm render for the new entity will atomically update the textures via noteCachedTextures().

Cached textures are only cleared on explicit deselection (selectedEntity == entt::null).


The documentation for this struct was generated from the following file: