aboutsummaryrefslogtreecommitdiff
path: root/internal/ui
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-05 20:00:02 -0400
committerhistoria <[not public]>2026-10-05 20:00:02 -0400
commit4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1 (patch)
treef7ea1da2f88f37c44b937aaaf1fd12c722811147 /internal/ui
parenta5447965e7808d656a5e5d9326a9ca0231148f85 (diff)
downloadthehouseoficarus-4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1.tar.gz
feat: terminal talk action, typed pai gow poker phase
Diffstat (limited to 'internal/ui')
-rw-r--r--internal/ui/table.go7
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