From fd5e642fb495e98bde0f7e7fd16dca7ac355c60a Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 26 Nov 2024 12:37:53 +0000 Subject: [PATCH] Tags shouldn't affect row height in equations (#5458) --- crates/typst-layout/src/math/run.rs | 5 ++++- .../ref/math-equation-tag-affects-row-height.png | Bin 0 -> 329 bytes tests/suite/math/equation.typ | 9 +++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/ref/math-equation-tag-affects-row-height.png diff --git a/crates/typst-layout/src/math/run.rs b/crates/typst-layout/src/math/run.rs index 8f12c5098..b07f5893a 100644 --- a/crates/typst-layout/src/math/run.rs +++ b/crates/typst-layout/src/math/run.rs @@ -419,7 +419,10 @@ impl MathRunFrameBuilder { } 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. diff --git a/tests/ref/math-equation-tag-affects-row-height.png b/tests/ref/math-equation-tag-affects-row-height.png new file mode 100644 index 0000000000000000000000000000000000000000..d0cc235993bbdf4c0ac463e42f91a8d107ab68d9 GIT binary patch literal 329 zcmV-P0k-~$P)du%@AI8iWNC*;3mu0VZ;$6%0=81XG>2|Np-T5jnaKk{NH1Yw