For example:
<img width="1904" alt="Screen Shot 2021-11-05 at 11 59 05 AM" src="https://user-images.githubusercontent.com/29597/140540816-25d6d47b-7aea-4121-aeaa-565accc65b1f.png">

if (sizeIsValid(newFrame.size)) {
        this.frame = newFrame;
      } else {
        this.frame = zeroRect;
      }
      this.setNeedsDisplay();
    }
  }
  setVisibleArea(newVisibleArea: Rect) {
    if (!rectEqualToRect(this.visibleArea, newVisibleArea)) {
      if (sizeIsValid(newVisibleArea.size)) {
        this.visibleArea = newVisibleArea;
      } else {
        this.visibleArea = zeroRect;
      }
      this.setNeedsDisplay();
    }
  }
  /**
   * A size that can be used as a hint by layout functions.
   *
   * Implementations should typically return the intrinsic content size or a
   * size that fits all the view's content.
   *
   * The default implementation returns a size that fits all the view's
   * subviews.
   *
   * Can be overridden by subclasses.
   */
  desiredSize(): Size | IntrinsicSize {