resolve method

DiagramRect resolve(
  1. FramedElement shape, {
  2. Map<String, double> textHeights = const {},
  3. Map<ShapeBoundsDefinition, DiagramRect>? memo,
})

Resolves this rule and its source chain against shape.

A memo shares resolved rules, including common parent chains, between calls. It is only valid for one shape state and one textHeights map.

Implementation

DiagramRect resolve(
  FramedElement shape, {
  Map<String, double> textHeights = const {},
  Map<ShapeBoundsDefinition, DiagramRect>? memo,
}) {
  if (memo?[this] case final known?) return known;
  final base =
      source?.resolve(shape, textHeights: textHeights, memo: memo) ??
      shape.frame;
  final resolved = _resolveFrom(base, shape, textHeights);
  memo?[this] = resolved;
  return resolved;
}