Donner 0.8.0-pre
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::editor::UndoSnapshot Struct Reference

Captured state of an element at a point in time. More...

#include "donner/editor/UndoTimeline.h"

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

Public Types

enum class  Kind : std::uint8_t {
  Transform ,
  DocumentSource
}
 The kind of state captured by this snapshot. More...

Public Attributes

Kind kind = Kind::Transform
 Snapshot payload kind.
svg::SVGElement element
 The element this snapshot applies to.
Transform2d transform
 The captured transform.
std::optional< AttributeWritebackTargetwritebackTarget
 Stable locator for the element, used to resolve a live handle after a self-initiated ReplaceDocument swaps the document identity.
std::optional< RcStringsourceTransformAttributeValue
 Exact transform= attribute bytes from the source pane, when undo should restore the user's original text verbatim instead of the canonical serializer output. std::nullopt means the attribute was absent in the captured source.
bool restoreSourceTransformAttributeValue = false
 Whether sourceTransformAttributeValue should be restored verbatim. When false, source writeback falls back to canonical serialization of transform.
std::string documentSource
 Full SVG source text for Kind::DocumentSource snapshots.
std::vector< AttributeWritebackTargetselectionTargets
 Selection targets to restore after a Kind::DocumentSource snapshot reparses the document.
std::vector< UndoSnapshotextras
 Additional element snapshots that belong to the same user operation. Multi-selection move/resize/rotate gestures use this so one UI undo restores the whole manipulation instead of stepping through elements one at a time.

Detailed Description

Captured state of an element at a point in time.

Member Enumeration Documentation

◆ Kind

enum class donner::editor::UndoSnapshot::Kind : std::uint8_t
strong

The kind of state captured by this snapshot.

Enumerator
Transform 

A graphics element's local transform.

DocumentSource 

The full SVG source text for structural edits such as element deletion.


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