registerKittyRegistry method

void registerKittyRegistry(
  1. Rect bounds,
  2. KittyImageRegistry registry
)

Registers a pane-scoped KittyImageRegistry for cells within bounds.

Implementation

void registerKittyRegistry(Rect bounds, KittyImageRegistry registry) {
  final clipped = _boundsClip.intersect(bounds);
  if (clipped.width <= 0 || clipped.height <= 0) return;
  if (_scopedKittyRegistries.isNotEmpty) {
    final last = _scopedKittyRegistries.last;
    if (identical(last.registry, registry) &&
        _rectCovers(clipped, last.bounds)) {
      _scopedKittyRegistries[_scopedKittyRegistries.length - 1] = (
        bounds: clipped,
        registry: registry,
      );
      return;
    }
  }
  _scopedKittyRegistries.add((bounds: clipped, registry: registry));
}