From 2f8b97f9c29eff0cb9f003749a0f4f5c64e7c54e Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 18 Apr 2024 14:55:20 +0200 Subject: [PATCH] Add regression tests for container sizing with layoutable child (#3955) --- tests/ref/box-layoutable-child.png | Bin 257 -> 0 bytes tests/ref/container-layoutable-child.png | Bin 0 -> 117 bytes tests/suite/layout/container.typ | 26 ++++++++++------------- 3 files changed, 11 insertions(+), 15 deletions(-) delete mode 100644 tests/ref/box-layoutable-child.png create mode 100644 tests/ref/container-layoutable-child.png diff --git a/tests/ref/box-layoutable-child.png b/tests/ref/box-layoutable-child.png deleted file mode 100644 index a1960a2498222865bb3bf732ca51158de116cef2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 257 zcmeAS@N?(olHy`uVBq!ia0vp^6+rC9!VDz8TKU=lDgFST5ZC`eaEIYxpU=7I+Ks#? zpPUnI1xl^;ba4!+xb^n>MqVaI9+$wV4|%K#<_QnEK75H6c3OV8TJrJah6DEXvnupr zzqg8H^H+Z7l#AG16!FEt=g~&K%@HM%%RZh+li0l9V|Lbr6XDGQT5ZO@# z6jb+gaSW-rl`O&fgmK-}g#iK$$7BmKuLW4hACjFaH+9**FBy^!atsVF#8=i=1$`?4 PYGLqn^>bP0l+XkK8+;@q literal 0 HcmV?d00001 diff --git a/tests/suite/layout/container.typ b/tests/suite/layout/container.typ index ede051dba..aff26bac2 100644 --- a/tests/suite/layout/container.typ +++ b/tests/suite/layout/container.typ @@ -18,21 +18,6 @@ Apart #block(width: 50%, height: 60%, fill: blue) ] ---- box-layoutable-child --- -// Test box sizing with layoutable child. -#box( - width: 50pt, - height: 50pt, - fill: yellow, - path( - fill: purple, - (0pt, 0pt), - (30pt, 30pt), - (0pt, 30pt), - (30pt, 0pt), - ), -) - --- box-width-fr --- // Test fr box. Hello #box(width: 1fr, rect(height: 0.7em, width: 100%)) World @@ -177,6 +162,17 @@ First! image("/assets/images/rhino.png", width: 30pt) ) +--- container-layoutable-child --- +// Test box/block sizing with directly layoutable child. +// +// Ensure that the output respects the box size. +#let check(f) = f( + width: 40pt, height: 25pt, fill: aqua, + grid(rect(width: 5pt, height: 5pt, fill: blue)), +) + +#stack(dir: ltr, spacing: 1fr, check(box), check(block)) + --- issue-2128-block-width-box --- // Test box in 100% width block. #block(width: 100%, fill: red, box("a box"))