From e1060924bf3582b75fa9e9475119c5e676dd9386 Mon Sep 17 00:00:00 2001 From: GloamXun Date: Tue, 20 Oct 2026 01:37:54 +0800 Subject: [PATCH] Prevent overfull inline math from overlapping words --- src/rust_typeset/math_layout.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/rust_typeset/math_layout.rs b/src/rust_typeset/math_layout.rs index 112a400..f09b0fd 100644 --- a/src/rust_typeset/math_layout.rs +++ b/src/rust_typeset/math_layout.rs @@ -5057,3 +5057,13 @@ fn math_mu_scaled(style: Style, units: Scaled) -> Mm { fn min_mm(left: Mm, right: Mm) -> Mm { if left <= right { left } else { right } } + +#[cfg(test)] +mod line_item_tests { + use super::{InlineMathItem, Mm}; + + #[test] + fn negative_inline_glue_keeps_a_minimum_word_space() { + assert_eq!(InlineMathItem::Glue(Mm::from(-2.0)).width(), Mm::from(0.6)); + } +}