summaryrefslogtreecommitdiff
path: root/library/src/math/row.rs
diff options
context:
space:
mode:
authorAlex Saveau <saveau.alexandre@gmail.com>2023-04-24 02:16:13 -0700
committerGitHub <noreply@github.com>2023-04-24 11:16:13 +0200
commitbc802bd8fb1656e5004b7c1b8a4e02ec7fc31aa8 (patch)
treef299db167684d0c553b1dd132b92a3ea348617ba /library/src/math/row.rs
parent5ccc6876194a3f9329021bf22e7c8d0ed6bf74a1 (diff)
Fix broken matrices with alignment and optimize code while we're at it (#935)
Diffstat (limited to 'library/src/math/row.rs')
-rw-r--r--library/src/math/row.rs7
1 files changed, 1 insertions, 6 deletions
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() {