propagateMetadataFrom method

void propagateMetadataFrom(
  1. Buffer source, {
  2. int dx = 0,
  3. int dy = 0,
  4. Rect? clip,
  5. int? zIndex,
})

Propagates region metadata (effects, selectableRegions, and scoped KittyImageRegistry bounds) from source translated by (dx, dy) and clipped to clip (or activeClip).

Implementation

void propagateMetadataFrom(
  Buffer source, {
  int dx = 0,
  int dy = 0,
  Rect? clip,
  int? zIndex,
}) {
  final effectiveClip = _boundsClip.intersect(clip ?? activeClip);
  if (effectiveClip.width <= 0 || effectiveClip.height <= 0) return;
  _propagateEffectsFrom(source, dx, dy, effectiveClip);
  _propagateSelectableRegionsFrom(source, dx, dy, effectiveClip, zIndex);
  _propagateRegistriesFrom(source, dx, dy, effectiveClip);
}