diff options
author | bptato <nincsnevem662@gmail.com> | 2024-08-30 22:34:30 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-08-30 22:45:23 +0200 |
commit | f3860cb04014ef508b5c3db2c4b10f888711a16f (patch) | |
tree | 8118096ce9acfa2c7993ff3858550102bc7d5c91 /src | |
parent | 0091042cd67cbacccccb7f474647a3999510ebf8 (diff) | |
download | chawan-f3860cb04014ef508b5c3db2c4b10f888711a16f.tar.gz |
layout: fix table height constraint type
it's really min-height, not height; consistency is not CSS's strong suit...
Diffstat (limited to 'src')
-rw-r--r-- | src/layout/engine.nim | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim index 7328839a..9d40b9ca 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -2041,7 +2041,15 @@ proc layoutTableRows(tctx: TableContext; table: BlockBox; y += tctx.blockSpacing y += row.state.size.h table.state.size.w = max(row.state.size.w, table.state.size.w) - table.state.size.h = applySizeConstraint(y, sizes.space.h) + # Note: we can't use applySizeConstraint here; in CSS, "height" on tables just + # sets the minimum height. + case sizes.space.h.t + of scStretch: + table.state.size.h = max(sizes.space.h.u, y) + of scMinContent, scMaxContent, scFitContent: + # I don't think these are ever used here; not that they make much sense for + # min-height... + table.state.size.h = y proc layoutCaption(tctx: TableContext; parent, box: BlockBox) = let space = availableSpace(w = stretch(parent.state.size.w), h = maxContent()) |