diff options
| author | Eric Biedert <github@ericbiedert.de> | 2023-09-26 16:59:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-26 16:59:51 +0200 |
| commit | 0d39fa021f2aa84c3302242082ea3bf23cc7f99d (patch) | |
| tree | 2535b718ca33bd5ea7a03d947b96f302a3526fb8 | |
| parent | 962071619d70975878fe93964422f0d0ed93945d (diff) | |
Prevent block spacing with placed elements (#2244)
| -rw-r--r-- | crates/typst-library/src/layout/mod.rs | 1 | ||||
| -rw-r--r-- | tests/ref/bugs/place-spacing.png | bin | 0 -> 6347 bytes | |||
| -rw-r--r-- | tests/typ/bugs/place-spacing.typ | 15 |
3 files changed, 16 insertions, 0 deletions
diff --git a/crates/typst-library/src/layout/mod.rs b/crates/typst-library/src/layout/mod.rs index 018cf1a6..4ff0bc92 100644 --- a/crates/typst-library/src/layout/mod.rs +++ b/crates/typst-library/src/layout/mod.rs @@ -547,6 +547,7 @@ impl<'a> FlowBuilder<'a> { if content.is::<VElem>() || content.is::<ColbreakElem>() || content.is::<MetaElem>() + || content.is::<PlaceElem>() { self.0.push(content.clone(), styles); return true; diff --git a/tests/ref/bugs/place-spacing.png b/tests/ref/bugs/place-spacing.png Binary files differnew file mode 100644 index 00000000..d14ce6ec --- /dev/null +++ b/tests/ref/bugs/place-spacing.png diff --git a/tests/typ/bugs/place-spacing.typ b/tests/typ/bugs/place-spacing.typ new file mode 100644 index 00000000..4d7b5fe3 --- /dev/null +++ b/tests/typ/bugs/place-spacing.typ @@ -0,0 +1,15 @@ +// Test that placed elements don't add extra block spacing. + +--- +#show figure: set block(spacing: 4em) + +Paragraph before float. +#figure(rect(), placement: bottom) +Paragraph after float. + +--- +#show place: set block(spacing: 4em) + +Paragraph before place. +#place(rect()) +Paragraph after place. |
