diff options
| author | historia <[not public]> | 2026-10-05 20:00:02 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-05 20:00:02 -0400 |
| commit | 4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1 (patch) | |
| tree | f7ea1da2f88f37c44b937aaaf1fd12c722811147 /internal/ui/table.go | |
| parent | a5447965e7808d656a5e5d9326a9ca0231148f85 (diff) | |
| download | thehouseoficarus-4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1.tar.gz | |
feat: terminal talk action, typed pai gow poker phase
Diffstat (limited to 'internal/ui/table.go')
| -rw-r--r-- | internal/ui/table.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/ui/table.go b/internal/ui/table.go index 8a056fb..437c445 100644 --- a/internal/ui/table.go +++ b/internal/ui/table.go @@ -38,6 +38,13 @@ type Table struct { Rows [][]string } +// FitWidths shrinks colWidths in place so their sum fits budget, using the +// same fair-share algorithm Table.Render uses. Exported so callers that +// pre-wrap cells can size them consistently instead of reimplementing it. +func FitWidths(colWidths []int, budget int) { + rebalanceWidths(colWidths, budget) +} + // rebalanceWidths shrinks column widths in place so their sum fits budget. // Rather than crushing only the last column, every column wider than the // fair share (budget/nCols) is capped first, then columns are trimmed one |
