Skeleton.withOffsetAndCrop constructor

Skeleton.withOffsetAndCrop(
  1. Skeleton skeleton,
  2. Rect? parentRect,
  3. Offset offset
)

Implementation

Skeleton.withOffsetAndCrop(
  Skeleton skeleton,
  Rect? parentRect,
  Offset offset,
) {
  if (parentRect != null)
    this.rect = skeleton.rect!.shift(offset).intersect(parentRect);
  else
    this.rect = skeleton.rect!.shift(offset);

  this.isText = skeleton.isText;
  this.color = skeleton.color;
  this.opacity = skeleton.opacity;
}