Skip to content

Commit 8aeee28

Browse files
committed
added option 'largest fragment' to property calculation
1 parent a5eb70a commit 8aeee28

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/actelion/research/gui/table/JTableWithRowNumbers.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,11 @@ public void mouseMoved(MouseEvent e) {
277277
mDragStartRowHeight = mTable.getRowHeight();
278278
int tolerance = HiDPIHelper.scale(cResizeTolerance);
279279
int row = y / mDragStartRowHeight;
280+
if (row >= mTable.getRowCount())
281+
row = -1;
280282
int fracY = y % mDragStartRowHeight;
281283

282-
mResizingStartRow = (fracY <= tolerance && row > 0) ? row - 1 : (fracY >= mDragStartRowHeight - tolerance) ? row : -1;
284+
mResizingStartRow = (row == -1) ? -1 : (fracY <= tolerance && row > 0) ? row - 1 : (fracY >= mDragStartRowHeight - tolerance) ? row : -1;
283285
setCursor(mResizingStartRow == -1 ? JTableWithRowNumbers.sDefaultCursor : JTableWithRowNumbers.sResizeCursor);
284286

285287
if (mHighlightedRow != row) {

0 commit comments

Comments
 (0)