summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-06-11 14:42:20 +0200
committerLaurenz <laurmaedje@gmail.com>2021-06-11 14:42:20 +0200
commit4017b5a9f67e06145129d75de452c8a42e2d2f5a (patch)
tree8ce9c6f80faa75ed62d4f7fbe31d3ceee6e8d4ba /tests
parent4dbd9285c91d59d527f4324df4aaf239ecb007ca (diff)
Push some nodes directly into the stack
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/layout/fixed.pngbin1372 -> 1389 bytes
-rw-r--r--tests/ref/layout/pad.pngbin1226 -> 44396 bytes
-rw-r--r--tests/typ/layout/fixed.typ6
-rw-r--r--tests/typ/layout/pad.typ16
4 files changed, 16 insertions, 6 deletions
diff --git a/tests/ref/layout/fixed.png b/tests/ref/layout/fixed.png
index e07e15e8..5ee9c4ff 100644
--- a/tests/ref/layout/fixed.png
+++ b/tests/ref/layout/fixed.png
Binary files differ
diff --git a/tests/ref/layout/pad.png b/tests/ref/layout/pad.png
index 0bf0adde..645c8db4 100644
--- a/tests/ref/layout/pad.png
+++ b/tests/ref/layout/pad.png
Binary files 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]