diff options
Diffstat (limited to 'library/src')
| -rw-r--r-- | library/src/math/row.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/library/src/math/row.rs b/library/src/math/row.rs index 26172303..ce9bc94a 100644 --- a/library/src/math/row.rs +++ b/library/src/math/row.rs @@ -127,11 +127,15 @@ impl MathRow { TIGHT_LEADING.scaled(ctx) }; - let rows: Vec<_> = fragments + let mut rows: Vec<_> = fragments .split(|frag| matches!(frag, MathFragment::Linebreak)) .map(|slice| Self(slice.to_vec())) .collect(); + if matches!(rows.last(), Some(row) if row.0.is_empty()) { + rows.pop(); + } + let width = rows.iter().map(|row| row.width()).max().unwrap_or_default(); let points = alignments(&rows); let mut frame = Frame::new(Size::zero()); |
