From bc802bd8fb1656e5004b7c1b8a4e02ec7fc31aa8 Mon Sep 17 00:00:00 2001 From: Alex Saveau Date: Mon, 24 Apr 2023 02:16:13 -0700 Subject: Fix broken matrices with alignment and optimize code while we're at it (#935) --- library/src/math/row.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'library/src/math/row.rs') diff --git a/library/src/math/row.rs b/library/src/math/row.rs index aa6f76f6..23c9d242 100644 --- a/library/src/math/row.rs +++ b/library/src/math/row.rs @@ -87,10 +87,6 @@ impl MathRow { self.iter().map(MathFragment::width).sum() } - pub fn height(&self) -> Abs { - self.ascent() + self.descent() - } - pub fn ascent(&self) -> Abs { self.iter().map(MathFragment::ascent).max().unwrap_or_default() } @@ -136,8 +132,7 @@ impl MathRow { rows.pop(); } - let width = rows.iter().map(|row| row.width()).max().unwrap_or_default(); - let points = alignments(&rows); + let AlignmentResult { points, width } = alignments(&rows); let mut frame = Frame::new(Size::zero()); for (i, row) in rows.into_iter().enumerate() { -- cgit v1.2.3