restoreSnapshot method

void restoreSnapshot()

Restore the layer to the last saveSnapshot. No-op if none saved.

Implementation

void restoreSnapshot() {
  final s = _snapshot;
  if (s == null) return;
  entities
    ..clear()
    ..addAll([for (final e in s.entities) e.copyWith()]);
  _selected = s.selected;
  _editing = s.editing;
  pendingStyle = s.style;
  pendingAlign = s.align;
  pendingColour = s.colour;
  pendingFontSize = s.fontSize;
  notifyListeners();
}