From 4017b5a9f67e06145129d75de452c8a42e2d2f5a Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 11 Jun 2021 14:42:20 +0200 Subject: Push some nodes directly into the stack --- tests/ref/layout/fixed.png | Bin 1372 -> 1389 bytes tests/ref/layout/pad.png | Bin 1226 -> 44396 bytes tests/typ/layout/fixed.typ | 6 +++--- tests/typ/layout/pad.typ | 16 +++++++++++++--- 4 files changed, 16 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/ref/layout/fixed.png b/tests/ref/layout/fixed.png index e07e15e8..5ee9c4ff 100644 Binary files a/tests/ref/layout/fixed.png and b/tests/ref/layout/fixed.png differ diff --git a/tests/ref/layout/pad.png b/tests/ref/layout/pad.png index 0bf0adde..645c8db4 100644 Binary files a/tests/ref/layout/pad.png and b/tests/ref/layout/pad.png differ diff --git a/tests/typ/layout/fixed.typ b/tests/typ/layout/fixed.typ index bcb88fe1..51646eaa 100644 --- a/tests/typ/layout/fixed.typ +++ b/tests/typ/layout/fixed.typ @@ -1,14 +1,14 @@ -// Test shrink-to-fit vs fixed. +// Test shrink-to-fit vs expand. --- #let right(body) = align(right, body) #let pad(body) = pad(left: 10pt, right: 10pt, body) -// Top-level paragraph fills page, boxed paragraph only when width is fixed. +// Top-level paragraph fills page, boxed paragraph only when the width is set. L #right[R] \ #rect(width: 50pt)[L #right[R]] \ #rect[L #right[R]] // Pad inherits expansion behaviour. -#pad[PL #right[PR]] \ #rect(pad[PL #right[PR]]) +#pad[PL #right[PR]] diff --git a/tests/typ/layout/pad.typ b/tests/typ/layout/pad.typ index 3726ce53..8c23549a 100644 --- a/tests/typ/layout/pad.typ +++ b/tests/typ/layout/pad.typ @@ -5,9 +5,19 @@ #pad(left: 10pt, [Indented!]) // All sides together. -#rect(fill: conifer, - pad(10pt, right: 20pt, - rect(width: 20pt, height: 20pt, fill: #eb5278))) +#rect(fill: conifer)[ + #pad(10pt, right: 20pt)[ + #rect(width: 20pt, height: 20pt, fill: #eb5278) + ] +] // Error: 14-24 missing argument: body Hi #rect(pad(left: 10pt)) there + +--- +// Test that the pad node doesn't consume the whole region. + +#page(width: 4cm, height: 5cm) +#align(left)[Before] +#pad(10pt, image("../../res/tiger.jpg")) +#align(right)[After] -- cgit v1.2.3