From 843afdfe4ff4c14a5e27316a8c7d20d385af37a1 Mon Sep 17 00:00:00 2001 From: Marius Date: Thu, 13 May 2021 20:25:04 +0200 Subject: [PATCH] Make ratios behave like ratios (#622) Integer division causes miscalculation of pane widths. With `set ratios 100:200:300` the first two panes have width 0, the third pane will take up all space (unless you happen to have a huge terminal). I noticed this when fine tuning ratios, e.g. going from `1:2:3` to something like `10:21:30`. --- ui.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui.go b/ui.go index bb1db51a..b49c5e1c 100644 --- a/ui.go +++ b/ui.go @@ -499,7 +499,7 @@ func getWidths(wtot int) []int { wsum := 0 for i := 0; i < wlen-1; i++ { - widths[i] = gOpts.ratios[i] * (wtot / rsum) + widths[i] = gOpts.ratios[i] * wtot / rsum wsum += widths[i] } widths[wlen-1] = wtot - wsum