fix TableUtil#scrollSelectionToVisible not scrolling outside of visible area

This commit is contained in:
Sergey Savenko
2014-11-13 14:17:16 +03:00
parent 34f150bf65
commit 1360541825
@@ -67,7 +67,7 @@ public class TableUtil {
Rectangle maxCellRect = table.getCellRect(maxSelectionIndex, maxColumnSelectionIndex, false);
Point selectPoint = minCellRect.getLocation();
int allHeight = maxCellRect.y + maxCellRect.height - minCellRect.y;
allHeight = Math.min(allHeight, table.getVisibleRect().height);
allHeight = Math.min(allHeight, table.getHeight());
table.scrollRectToVisible(new Rectangle(selectPoint, new Dimension(minCellRect.width / 2,allHeight)));
}