getScrollPositionForCell({
    align,
    cellIndex,
    height,
    scrollLeft,
    scrollTop,
    width,
  }): ScrollPosition {
    const {cellCount} = this.props;

    if (cellIndex >= 0 && cellIndex < cellCount) {
      const cellMetadata = this._cellMetadata[cellIndex];

      scrollLeft = getUpdatedOffsetForIndex({
        align,
        cellOffset: cellMetadata.x,
        cellSize: cellMetadata.width,
        containerSize: width,
        currentOffset: scrollLeft,
        targetIndex: cellIndex,
      });

      scrollTop = getUpdatedOffsetForIndex({
        align,
        cellOffset: cellMetadata.y,
        cellSize: cellMetadata.height,
        containerSize: height,
        currentOffset: scrollTop,
        targetIndex: cellIndex,
      });
    }

    return {
      scrollLeft,
      scrollTop,
    };
  }
Calculates the minimum amount of change from the current scroll position to ensure the specified cell is (fully) visible.