diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-06-24 15:05:59 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-06-24 15:05:59 +0200 |
| commit | f1025071edfb787309a75d4bb68bec0c2bd906bb (patch) | |
| tree | b28d6cf05b8a8f29acbfb44093e3c9bface802b6 /library/src/math | |
| parent | b96b7b7ee12a5d1c8e8c24c95b58b7ca03cec44b (diff) | |
Tidy up
Diffstat (limited to 'library/src/math')
| -rw-r--r-- | library/src/math/attach.rs | 7 | ||||
| -rw-r--r-- | library/src/math/row.rs | 8 | ||||
| -rw-r--r-- | library/src/math/underover.rs | 3 |
3 files changed, 8 insertions, 10 deletions
diff --git a/library/src/math/attach.rs b/library/src/math/attach.rs index 158e5f0d..fedeb908 100644 --- a/library/src/math/attach.rs +++ b/library/src/math/attach.rs @@ -125,11 +125,10 @@ pub struct LimitsElem { #[required] pub body: Content, - /// Whether to apply limits in inline equations. + /// Whether to also force limits in inline equations. /// - /// It is useful to disable this setting - /// in most cases of applying limits globally - /// (inside show rules or new elements) + /// When applying limits globally (e.g., through a show rule), it is + /// typically a good idea to disable this. #[default(true)] pub inline: bool, } diff --git a/library/src/math/row.rs b/library/src/math/row.rs index 1704dbf1..687f82b8 100644 --- a/library/src/math/row.rs +++ b/library/src/math/row.rs @@ -85,11 +85,11 @@ impl MathRow { self.0.iter() } - /// It is very unintuitive, but in current state of things - /// `MathRow` can contain several actual rows. - /// That function deconstructs it to "single" rows. + /// Extract the sublines of the row. /// - /// Hopefully that cloner is only a temporary hack + /// It is very unintuitive, but in current state of things, a `MathRow` can + /// contain several actual rows. That function deconstructs it to "single" + /// rows. Hopefully this is only a temporary hack. pub fn rows(&self) -> Vec<Self> { self.0 .split(|frag| matches!(frag, MathFragment::Linebreak)) diff --git a/library/src/math/underover.rs b/library/src/math/underover.rs index df3ba582..29c0e543 100644 --- a/library/src/math/underover.rs +++ b/library/src/math/underover.rs @@ -206,9 +206,8 @@ fn layout( let body = body.into_fragment(ctx); let glyph = GlyphFragment::new(ctx, c, span); let stretched = glyph.stretch_horizontal(ctx, body.width(), Abs::zero()); - let body = MathRow::new(vec![body]); - let mut rows = vec![body, stretched.into()]; + let mut rows = vec![MathRow::new(vec![body]), stretched.into()]; ctx.style(if reverse { ctx.style.for_subscript() } else { |
