summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-07-19 12:53:36 +0200
committerGitHub <noreply@github.com>2023-07-19 12:53:36 +0200
commit3dcd8e6e6beb8c410e55141ca4fbc840679a1f14 (patch)
tree65e9c2c73443e471100a30c096a2424dfdd313e8 /tests
parentb37c1e27314ed9b9341dd82c1bbc8238121c7578 (diff)
Positions placed elements relative to real container size (#1745)
This positions placed elements relative to the real container size instead of relative to the base size of the region. This makes its usage more versatile. Fixes #82 Fixes #685 Fixes #1705
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/bugs/place-nested.pngbin0 -> 1298 bytes
-rw-r--r--tests/ref/layout/place-nested.pngbin0 -> 6202 bytes
-rw-r--r--tests/typ/layout/place-nested.typ33
3 files changed, 33 insertions, 0 deletions
diff --git a/tests/ref/bugs/place-nested.png b/tests/ref/bugs/place-nested.png
new file mode 100644
index 00000000..b59dc5d3
--- /dev/null
+++ b/tests/ref/bugs/place-nested.png
Binary files differ
diff --git a/tests/ref/layout/place-nested.png b/tests/ref/layout/place-nested.png
new file mode 100644
index 00000000..ccd55ee4
--- /dev/null
+++ b/tests/ref/layout/place-nested.png
Binary files differ
diff --git a/tests/typ/layout/place-nested.typ b/tests/typ/layout/place-nested.typ
new file mode 100644
index 00000000..c979176a
--- /dev/null
+++ b/tests/typ/layout/place-nested.typ
@@ -0,0 +1,33 @@
+// Test vertical alignment with nested placement.
+
+---
+#box(
+ fill: aqua,
+ width: 30pt,
+ height: 30pt,
+ place(bottom,
+ place(line(start: (0pt, 0pt), end: (20pt, 0pt), stroke: red + 3pt))
+ )
+)
+
+---
+#box(
+ fill: aqua,
+ width: 30pt,
+ height: 30pt,
+ {
+ box(fill: yellow, {
+ [Hello]
+ place(horizon, line(start: (0pt, 0pt), end: (20pt, 0pt), stroke: red + 2pt))
+ })
+ place(horizon, line(start: (0pt, 0pt), end: (20pt, 0pt), stroke: green + 3pt))
+ }
+)
+
+---
+#box(fill: aqua)[
+ #place(bottom + right)[Hi]
+ Hello World \
+ How are \
+ you?
+]