From de759debe31d67776a7a70d3d4dc41a89591cdfc Mon Sep 17 00:00:00 2001 From: bptato Date: Mon, 30 Dec 2024 19:05:08 +0100 Subject: layout: fix an overflow bug --- src/css/layout.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/css') diff --git a/src/css/layout.nim b/src/css/layout.nim index c62d14a9..66839327 100644 --- a/src/css/layout.nim +++ b/src/css/layout.nim @@ -1244,12 +1244,14 @@ proc applyIntr(box: BlockBox; sizes: ResolvedSizes; intr: Size) = box.state.intr[dim] = intr[dim].minClamp(sizes.bounds.mi[dim]) else: # We do not have a scroll bar, so do the next best thing: expand the - # box to the size its contents want. + # box to the size its contents want. (Or the specified size, if + # it's greater.) #TODO intrinsic minimum size isn't really guaranteed to equal the # desired scroll size. Also, it's possible that a parent box clamps # the height of this box; in that case, the parent box's # width/height should be clamped to the inner scroll width/height # instead. + box.state.intr[dim] = max(intr[dim], sizes.bounds.mi[dim].start) box.state.size[dim] = max(box.state.size[dim], intr[dim]) proc applyBaseline(box: BlockBox) = -- cgit