private void calculateLengths(TablePassInfo data) {
    boolean compressible = isCompressible();
    boolean showPinnedTabsSeparately = showPinnedTabsSeparately();

    int standardLengthToFit = data.moreRect.x - (data.titleRect.x + data.titleRect.width) - myTabs.getActionsInsets().left;
    if (compressible || showPinnedTabsSeparately) {
      if (showPinnedTabsSeparately) {
        List<TabInfo> pinned = ContainerUtil.filter(data.visibleInfos, info -> info.isPinned());
        calculateCompressibleLengths(pinned, data, standardLengthToFit);
        List<TabInfo> unpinned = ContainerUtil.filter(data.visibleInfos, info -> !info.isPinned());
        if (compressible) {
          Insets insets = myTabs.getActionsInsets();
          calculateCompressibleLengths(unpinned, data, pinned.isEmpty()
                                                       ? standardLengthToFit
                                                       : standardLengthToFit + data.titleRect.width + myTabs.getEntryPointPreferredSize().width + insets.left + insets.right);
        }
        else {
          calculateRawLengths(unpinned, data);
          if (getTotalLength(unpinned, data) > standardLengthToFit) {
            int moreWidth = getMoreRectAxisSize();
            int entryPointsWidth = pinned.isEmpty() ? myTabs.getEntryPointPreferredSize().width : 0;
            data.moreRect.setBounds(data.toFitRec.x + data.toFitRec.width - moreWidth - entryPointsWidth - myTabs.getActionsInsets().right,
                                    myTabs.getLayoutInsets().top, moreWidth, myTabs.getHeaderFitSize().height);
            calculateRawLengths(unpinned, data);
          }
        }
      }
      else {
        calculateCompressibleLengths(data.visibleInfos, data, standardLengthToFit);
      }
    }
    else {//both scrollable and multi-row
      calculateRawLengths(data.visibleInfos, data);
      if (getTotalLength(data.visibleInfos, data) > standardLengthToFit) {
        int moreWidth = getMoreRectAxisSize();
        data.moreRect.setBounds(data.toFitRec.x + data.toFitRec.width - moreWidth, data.toFitRec.y, moreWidth, myTabs.getHeaderFitSize().height);
        calculateRawLengths(data.visibleInfos, data);
      }
    }
  }
private void calculateLengths(TablePassInfo data)