#114 fix crash when sizing very small

This commit is contained in:
Autumn Lamonte 2024-08-31 22:25:05 -05:00
parent 2bdf297521
commit 52306074d6

View file

@ -1224,7 +1224,9 @@ public class TTableWidget extends TWidget {
// Set left and top such that the table stays on screen if possible. // Set left and top such that the table stays on screen if possible.
top = rows.size() - getHeight(); top = rows.size() - getHeight();
left = columns.size() - (getWidth() / (viewColumns / (COLUMN_DEFAULT_WIDTH + 1))); int visibleColumnWidth = Math.max(1,
(viewColumns / (COLUMN_DEFAULT_WIDTH + 1)));
left = columns.size() - (getWidth() / visibleColumnWidth);
// Now ensure the selection is visible. // Now ensure the selection is visible.
alignGrid(); alignGrid();
} }