int (@NotNull VcsLogGraphTable table, @NotNull Collection<? extends PrintElement> printElements) { if (printElements.isEmpty()) return 0; double maxIndex = 0; for (PrintElement printElement : printElements) { maxIndex = Math.max(maxIndex, printElement.getPositionInCurrentRow()); if (printElement instanceof EdgePrintElement) { maxIndex = Math.max(maxIndex, (printElement.getPositionInCurrentRow() + ((EdgePrintElement)printElement).getPositionInOtherRow()) / 2.0); } } maxIndex++; maxIndex = Math.max(maxIndex, Math.min(MAX_GRAPH_WIDTH, table.getVisibleGraph().getRecommendedWidth())); return (int)(maxIndex * PaintParameters.getNodeWidth(table.getRowHeight())); }