calculateCenterShift(center, resolution, rotation, size) {
    let centerShift;
    const padding = this.padding_;
    if (padding && center) {
      const reducedSize = this.getViewportSizeMinusPadding_(-rotation);
      const shiftedCenter = calculateCenterOn(
        center,
        size,
        [reducedSize[0] / 2 + padding[3], reducedSize[1] / 2 + padding[0]],
        resolution,
        rotation,
      );
      centerShift = [
        center[0] - shiftedCenter[0],
        center[1] - shiftedCenter[1],
      ];
    }
    return centerShift;
  }
Calculates the shift between map and viewport center.
@param {import("./coordinate.js").Coordinate} center Center.
@param {number} resolution Resolution.
@param {number} rotation Rotation.
@param {import("./size.js").Size} size Size.
@return {Array<number>|undefined} Center shift.