diff options
Diffstat (limited to 'library/src/math/matrix.rs')
| -rw-r--r-- | library/src/math/matrix.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/library/src/math/matrix.rs b/library/src/math/matrix.rs index 2243eb38..956c7f8a 100644 --- a/library/src/math/matrix.rs +++ b/library/src/math/matrix.rs @@ -272,8 +272,10 @@ fn layout_mat_body(ctx: &mut MathContext, rows: &[Vec<Content>]) -> SourceResult let mut y = Abs::zero(); for ((cell, &ascent), &descent) in col.into_iter().zip(&ascents).zip(&descents) { let cell = cell.into_aligned_frame(ctx, &points, Align::Center); - let pos = - Point::new(x + (rcol - cell.width()) / 2.0, y + ascent - cell.ascent()); + let pos = Point::new( + if points.is_empty() { x + (rcol - cell.width()) / 2.0 } else { x }, + y + ascent - cell.ascent(), + ); frame.push_frame(pos, cell); y += ascent + descent + row_gap; } |
