aboutsummaryrefslogtreecommitdiffstats
path: root/lib/card.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lib/card.lua')
-rw-r--r--lib/card.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/card.lua b/lib/card.lua
index 4163aae..3dd4b12 100644
--- a/lib/card.lua
+++ b/lib/card.lua
@@ -348,10 +348,13 @@ function M.standard(cr, inner, colors, spec)
groups[#groups + 1] = { { r[1], M.FONT_MONO, ROW_F },
{ r[2] == nil and '--' or tostring(r[2]), M.FONT_MONO, ROW_F } }
end
- -- Height in units of S: the header line, the gap under it, a step per row.
+ -- Height in units of S: the header line, a little air, a 0.64 step per row
+ -- (the first row's baseline sits 0.512 under the header, the last row's
+ -- descent takes about 0.1, so this leaves a few percent of slack and no
+ -- empty strip under the rows).
local head_f = (big or not spec.title) and BIG_F or LABEL_F * 1.2
local budget = inner.h * (spec.share or 1)
- local S = clamp(math.min(budget * 0.94 / (head_f + 0.5 + #rows * 0.66),
+ local S = clamp(math.min(budget / (head_f + 0.2 + #rows * 0.64),
M.fit_unit(cr, inner.w * 0.96, groups, 100)), 10, 72)
local label_size, row_size = S * LABEL_F, S * ROW_F