mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Use list spacing for attach spacing in tight lists (#6242)
This commit is contained in:
parent
b322da930f
commit
9b09146a6b
@ -259,10 +259,11 @@ impl Show for Packed<EnumElem> {
|
|||||||
.spanned(self.span());
|
.spanned(self.span());
|
||||||
|
|
||||||
if tight {
|
if tight {
|
||||||
let leading = ParElem::leading_in(styles);
|
let spacing = self
|
||||||
let spacing =
|
.spacing(styles)
|
||||||
VElem::new(leading.into()).with_weak(true).with_attach(true).pack();
|
.unwrap_or_else(|| ParElem::leading_in(styles).into());
|
||||||
realized = spacing + realized;
|
let v = VElem::new(spacing.into()).with_weak(true).with_attach(true).pack();
|
||||||
|
realized = v + realized;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(realized)
|
Ok(realized)
|
||||||
|
@ -166,10 +166,11 @@ impl Show for Packed<ListElem> {
|
|||||||
.spanned(self.span());
|
.spanned(self.span());
|
||||||
|
|
||||||
if tight {
|
if tight {
|
||||||
let leading = ParElem::leading_in(styles);
|
let spacing = self
|
||||||
let spacing =
|
.spacing(styles)
|
||||||
VElem::new(leading.into()).with_weak(true).with_attach(true).pack();
|
.unwrap_or_else(|| ParElem::leading_in(styles).into());
|
||||||
realized = spacing + realized;
|
let v = VElem::new(spacing.into()).with_weak(true).with_attach(true).pack();
|
||||||
|
realized = v + realized;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(realized)
|
Ok(realized)
|
||||||
|
@ -189,13 +189,15 @@ impl Show for Packed<TermsElem> {
|
|||||||
.styled(TermsElem::set_within(true));
|
.styled(TermsElem::set_within(true));
|
||||||
|
|
||||||
if tight {
|
if tight {
|
||||||
let leading = ParElem::leading_in(styles);
|
let spacing = self
|
||||||
let spacing = VElem::new(leading.into())
|
.spacing(styles)
|
||||||
|
.unwrap_or_else(|| ParElem::leading_in(styles).into());
|
||||||
|
let v = VElem::new(spacing.into())
|
||||||
.with_weak(true)
|
.with_weak(true)
|
||||||
.with_attach(true)
|
.with_attach(true)
|
||||||
.pack()
|
.pack()
|
||||||
.spanned(span);
|
.spanned(span);
|
||||||
realized = spacing + realized;
|
realized = v + realized;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(realized)
|
Ok(realized)
|
||||||
|
BIN
tests/ref/issue-6242-tight-list-attach-spacing.png
Normal file
BIN
tests/ref/issue-6242-tight-list-attach-spacing.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 410 B |
@ -304,3 +304,11 @@ World
|
|||||||
- C
|
- C
|
||||||
- = D
|
- = D
|
||||||
E
|
E
|
||||||
|
|
||||||
|
--- issue-6242-tight-list-attach-spacing ---
|
||||||
|
// Nested tight lists should be uniformly spaced when list spacing is set.
|
||||||
|
#set list(spacing: 1.2em)
|
||||||
|
- A
|
||||||
|
- B
|
||||||
|
- C
|
||||||
|
- C
|
||||||
|
Loading…
x
Reference in New Issue
Block a user