summaryrefslogtreecommitdiff
path: root/library/src/math/matrix.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-01-23 15:03:10 +0100
committerLaurenz <laurmaedje@gmail.com>2023-01-23 15:23:52 +0100
commit4653ffebb43d733a3cff873d0903c7d00aaeb499 (patch)
tree6a97b2e6a6903b3198547d6f3d0a7e3d2eb023cd /library/src/math/matrix.rs
parent84c6c8b0e6b17996a603ec88b7490107154f38f3 (diff)
Math module
Diffstat (limited to 'library/src/math/matrix.rs')
-rw-r--r--library/src/math/matrix.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/library/src/math/matrix.rs b/library/src/math/matrix.rs
index aa21e9cf..9472e989 100644
--- a/library/src/math/matrix.rs
+++ b/library/src/math/matrix.rs
@@ -161,6 +161,7 @@ fn layout(
) -> SourceResult<()> {
let axis = scaled!(ctx, axis_height);
let gap = ROW_GAP.scaled(ctx);
+ let short_fall = DELIM_SHORT_FALL.scaled(ctx);
ctx.style(ctx.style.for_denominator());
let mut rows = vec![];
@@ -169,17 +170,20 @@ fn layout(
}
ctx.unstyle();
- if let Some(left) = left {
- ctx.push(GlyphFragment::new(ctx, left));
- }
-
let mut frame = stack(ctx, rows, align, gap, 0);
+ let height = frame.height();
frame.set_baseline(frame.height() / 2.0 + axis);
+ if let Some(left) = left {
+ ctx.push(GlyphFragment::new(ctx, left).stretch_vertical(ctx, height, short_fall));
+ }
+
ctx.push(frame);
if let Some(right) = right {
- ctx.push(GlyphFragment::new(ctx, right));
+ ctx.push(
+ GlyphFragment::new(ctx, right).stretch_vertical(ctx, height, short_fall),
+ );
}
Ok(())