From 244ad386ec271ff86a2101eb4cc38d37a55552b9 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 15 Dec 2021 12:49:20 +0100 Subject: Set Rules Episode VI: Return of the Refactor --- tests/ref/layout/placed.png | Bin 31901 -> 33917 bytes tests/ref/layout/spacing.png | Bin 1827 -> 2412 bytes tests/typ/layout/placed.typ | 13 +++++++++++++ tests/typ/layout/spacing.typ | 7 +++++++ 4 files changed, 20 insertions(+) (limited to 'tests') diff --git a/tests/ref/layout/placed.png b/tests/ref/layout/placed.png index 10a0bfd4..4fdb1f70 100644 Binary files a/tests/ref/layout/placed.png and b/tests/ref/layout/placed.png differ diff --git a/tests/ref/layout/spacing.png b/tests/ref/layout/spacing.png index c653df6d..6c7a4e63 100644 Binary files a/tests/ref/layout/spacing.png and b/tests/ref/layout/spacing.png differ diff --git a/tests/typ/layout/placed.typ b/tests/typ/layout/placed.typ index 334ff80d..017cdc20 100644 --- a/tests/typ/layout/placed.typ +++ b/tests/typ/layout/placed.typ @@ -1,3 +1,6 @@ +// Test the `place` function. + +--- #page("a8") #place(bottom + center)[© Typst] @@ -20,3 +23,13 @@ the line breaks still had to be inserted manually. #place(center, dx: 7pt, dy: 5pt)[Hello] Hello #h(1fr) Hello ] + +--- +// Test how the placed node interacts with paragraph spacing around it. +#page("a8", height: 60pt) + +First + +#place(bottom + right)[Placed] + +Second diff --git a/tests/typ/layout/spacing.typ b/tests/typ/layout/spacing.typ index 7cf6760f..78b778c5 100644 --- a/tests/typ/layout/spacing.typ +++ b/tests/typ/layout/spacing.typ @@ -17,6 +17,13 @@ Add #h(10pt) #h(10pt) up // Fractional. | #h(1fr) | #h(2fr) | #h(1fr) | +--- +// Test that spacing has style properties. + +A[#par(align: right)#h(1cm)]B +[#page(height: 20pt)#v(1cm)] +B + --- // Missing spacing. // Error: 11-13 missing argument: spacing -- cgit v1.2.3