private void doScrollToSelectedTab(SingleRowPassInfo passInfo) {
    if (tabs.isMouseInsideTabsArea() || tabs.isScrollBarAdjusting$intellij_platform_ide() || tabs.isRecentlyActive()) {
      return;
    }
    int offset = -myScrollOffset;
    for (TabInfo info : passInfo.visibleInfos) {
      final int length = getRequiredLength(info);
      if (info == tabs.getSelectedInfo()) {
        if (offset < 0) {
          scroll(offset);
        }
        else {
          int maxLength = passInfo.toFitLength - getMoreRectAxisSize();
          Insets actionInsets = tabs.getActionsInsets();
          if (tabs.getEntryPointPreferredSize().width == 0) {
            maxLength -= tabs.isHorizontalTabs() ? actionInsets.left + actionInsets.right
                                                 : actionInsets.top + actionInsets.bottom;
          }
          if (!ExperimentalUI.isNewUI() && getStrategy() instanceof SingleRowLayoutStrategy.Vertical) {
            maxLength -= passInfo.entryPointAxisSize;
          }
          if (offset + length > maxLength) {
            // a left side should always be visible
            if (length < maxLength) {
              scroll(offset + length - maxLength);
            }
            else {
              scroll(offset);
            }
          }
        }
        break;
      }
      offset += length;
    }
  }
private void doScrollToSelectedTab(SingleRowPassInfo passInfo)