mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Tags shouldn't affect row height in equations (#5458)
This commit is contained in:
parent
6d35972c3d
commit
fd5e642fb4
@ -419,7 +419,10 @@ impl MathRunFrameBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn affects_row_height(fragment: &MathFragment) -> bool {
|
fn affects_row_height(fragment: &MathFragment) -> bool {
|
||||||
!matches!(fragment, MathFragment::Align | MathFragment::Linebreak)
|
!matches!(
|
||||||
|
fragment,
|
||||||
|
MathFragment::Align | MathFragment::Linebreak | MathFragment::Tag(_)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create the spacing between two fragments in a given style.
|
/// Create the spacing between two fragments in a given style.
|
||||||
|
BIN
tests/ref/math-equation-tag-affects-row-height.png
Normal file
BIN
tests/ref/math-equation-tag-affects-row-height.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 329 B |
@ -260,6 +260,15 @@ $ q &= sum_k ln A \
|
|||||||
// Test numbering on empty equations.
|
// Test numbering on empty equations.
|
||||||
#math.equation(numbering: "1", block: true, [])
|
#math.equation(numbering: "1", block: true, [])
|
||||||
|
|
||||||
|
--- math-equation-tag-affects-row-height ---
|
||||||
|
// Tags should not affect the row height of equations.
|
||||||
|
#box($ - - $, fill: silver)
|
||||||
|
#box($ #metadata(none) - - $, fill: silver) \
|
||||||
|
#box($ a \ - - $, fill: silver)
|
||||||
|
#box($ a \ #metadata(none) - - $, fill: silver)
|
||||||
|
#box($ - - \ a $, fill: silver)
|
||||||
|
#box($ #metadata(none) - - \ a $, fill: silver)
|
||||||
|
|
||||||
--- issue-4187-alignment-point-affects-row-height ---
|
--- issue-4187-alignment-point-affects-row-height ---
|
||||||
// In this bug, a row of "-" only should have a very small height; but
|
// In this bug, a row of "-" only should have a very small height; but
|
||||||
// after adding an alignment point "&", the row gains a larger height.
|
// after adding an alignment point "&", the row gains a larger height.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user