summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeedehai <18319900+Leedehai@users.noreply.github.com>2024-05-07 10:08:42 -0400
committerGitHub <noreply@github.com>2024-05-07 14:08:42 +0000
commitcbb01fc81abac53874a8c88648ae7781f7312437 (patch)
tree4bfa5a5c2ab51aef825ceac80df8aa1efcece674
parentaa38b96849e2c8a8d7a462789e1f81e9f65d45b3 (diff)
Make more characters stretchable by mid() (#4092)
-rw-r--r--crates/typst/src/math/lr.rs2
-rw-r--r--tests/ref/math-lr-mid.pngbin1433 -> 1401 bytes
-rw-r--r--tests/suite/math/delimited.typ4
3 files changed, 4 insertions, 2 deletions
diff --git a/crates/typst/src/math/lr.rs b/crates/typst/src/math/lr.rs
index f92afbd5..671aa7df 100644
--- a/crates/typst/src/math/lr.rs
+++ b/crates/typst/src/math/lr.rs
@@ -122,10 +122,12 @@ impl LayoutMath for Packed<MidElem> {
MathFragment::Glyph(glyph) => {
let mut new = glyph.clone().into_variant();
new.mid_stretched = Some(false);
+ new.class = MathClass::Fence;
*fragment = MathFragment::Variant(new);
}
MathFragment::Variant(variant) => {
variant.mid_stretched = Some(false);
+ variant.class = MathClass::Fence;
}
_ => {}
}
diff --git a/tests/ref/math-lr-mid.png b/tests/ref/math-lr-mid.png
index e4f1e671..1e14759e 100644
--- a/tests/ref/math-lr-mid.png
+++ b/tests/ref/math-lr-mid.png
Binary files differ
diff --git a/tests/suite/math/delimited.typ b/tests/suite/math/delimited.typ
index 98579947..42a67c4e 100644
--- a/tests/suite/math/delimited.typ
+++ b/tests/suite/math/delimited.typ
@@ -48,9 +48,9 @@ $ lr(
--- math-lr-mid ---
// Test middle functions
$ { x mid(|) sum_(i=1)^oo phi_i (x) < 1 } \
- { integral |x| dif x
+ { integral |dot|
mid(bar.v.double)
- floor(hat(A) mid(|) { x mid(|) y } mid(|) A) } $
+ floor(hat(I) mid(slash) { dot mid(|) dot } mid(|) I/n) } $
--- math-lr-unbalanced ---
// Test unbalanced delimiters.