propagateMetadataFrom method

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

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

Implementation

@override
void propagateMetadataFrom(
  Buffer source, {
  int dx = 0,
  int dy = 0,
  Rect? clip,
  int? zIndex,
}) {
  final vpClip = clip == null
      ? bounds
      : bounds.intersect(
          Rect(bounds.x + clip.x, bounds.y + clip.y, clip.width, clip.height),
        );
  if (vpClip.width <= 0 || vpClip.height <= 0) return;
  parent.propagateMetadataFrom(
    source,
    dx: bounds.x + dx,
    dy: bounds.y + dy,
    clip: vpClip,
    zIndex: zIndex,
  );
}