mirror of
https://github.com/typst/typst
synced 2025-05-20 03:55:29 +08:00
Prevent block spacing with placed elements (#2244)
This commit is contained in:
parent
962071619d
commit
0d39fa021f
@ -547,6 +547,7 @@ impl<'a> FlowBuilder<'a> {
|
|||||||
if content.is::<VElem>()
|
if content.is::<VElem>()
|
||||||
|| content.is::<ColbreakElem>()
|
|| content.is::<ColbreakElem>()
|
||||||
|| content.is::<MetaElem>()
|
|| content.is::<MetaElem>()
|
||||||
|
|| content.is::<PlaceElem>()
|
||||||
{
|
{
|
||||||
self.0.push(content.clone(), styles);
|
self.0.push(content.clone(), styles);
|
||||||
return true;
|
return true;
|
||||||
|
BIN
tests/ref/bugs/place-spacing.png
Normal file
BIN
tests/ref/bugs/place-spacing.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
15
tests/typ/bugs/place-spacing.typ
Normal file
15
tests/typ/bugs/place-spacing.typ
Normal file
@ -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.
|
Loading…
x
Reference in New Issue
Block a user