resolve method

ResolvedScene resolve(
  1. DiagramDocument document, {
  2. String? defaultFontFamily,
})

Implementation

ResolvedScene resolve(DiagramDocument document, {String? defaultFontFamily}) {
  _shapeVisits = 0;
  _textVisits = 0;
  _connectorVisits = 0;
  _admissionVisits = (elements: 0, global: false);
  try {
    return _resolve(document, defaultFontFamily: defaultFontFamily);
  } catch (_) {
    // A failed candidate cannot lend partially written caches to another
    // branch. The already-published scene remains immutable and untouched.
    // Route provider failures never reach this path: they degrade to a
    // diagnosed fallback for that connector alone.
    _shapeCache.clear();
    _textCache.clear();
    _connectorCache.clear();
    _previousDocument = null;
    _previousScene = null;
    rethrow;
  }
}