mirror of
https://gitlab.com/AutumnMeowMeow/jexer
synced 2024-09-19 11:50:19 -06:00
#114 fix crash when sizing very small
This commit is contained in:
parent
2bdf297521
commit
52306074d6
1 changed files with 3 additions and 1 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue