about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-12-30 19:05:08 +0100
committerbptato <nincsnevem662@gmail.com>2024-12-30 19:05:08 +0100
commitde759debe31d67776a7a70d3d4dc41a89591cdfc (patch)
treebd9c35446ad0b0e9e5b607097165bbfda8f0ab34 /src
parent9bcb5285a871c80ca3f018f25a05dab2cc95325d (diff)
downloadchawan-de759debe31d67776a7a70d3d4dc41a89591cdfc.tar.gz
layout: fix an overflow bug
Diffstat (limited to 'src')
-rw-r--r--src/css/layout.nim4
1 files changed, 3 insertions, 1 deletions
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) =