docs: private float getOffset(
        float imageStart,
        float imageEnd,
        float limitStart,
        float limitEnd,
        float limitCenter) {
      float imageWidth = imageEnd - imageStart, limitWidth = limitEnd - limitStart;
      float limitInnerWidth = Math.min(limitCenter - limitStart, limitEnd - limitCenter) * 2;
      // center if smaller than limitInnerWidth
      if (imageWidth < limitInnerWidth) {
        return limitCenter - (imageEnd + imageStart) / 2;
      }
      // to the edge if in between and limitCenter is not (limitLeft + limitRight) / 2
      if (imageWidth < limitWidth) {
        if (limitCenter < (limitStart + limitEnd) / 2) {
          return limitStart - imageStart;
        } else {
          return limitEnd - imageEnd;
        }
      }
      // to the edge if larger than limitWidth and empty space visible
      if (imageStart > limitStart) {
        return limitStart - imageStart;
      }
      if (imageEnd < limitEnd) {
        return limitEnd - imageEnd;
      }
      return 0;
    }