summaryrefslogtreecommitdiff
path: root/crates/typst-layout/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-layout/src')
-rw-r--r--crates/typst-layout/src/math/mat.rs4
-rw-r--r--crates/typst-layout/src/math/shared.rs1
-rw-r--r--crates/typst-layout/src/math/underover.rs4
3 files changed, 5 insertions, 4 deletions
diff --git a/crates/typst-layout/src/math/mat.rs b/crates/typst-layout/src/math/mat.rs
index 6c8b0455..24104f4e 100644
--- a/crates/typst-layout/src/math/mat.rs
+++ b/crates/typst-layout/src/math/mat.rs
@@ -127,7 +127,9 @@ fn layout_vec_body(
let denom_style = style_for_denominator(styles);
let mut flat = vec![];
for child in column {
- flat.push(ctx.layout_into_run(child, styles.chain(&denom_style))?);
+ // We allow linebreaks in cases and vectors, which are functionally
+ // identical to commas.
+ flat.extend(ctx.layout_into_run(child, styles.chain(&denom_style))?.rows());
}
// We pad ascent and descent with the ascent and descent of the paren
// to ensure that normal vectors are aligned with others unless they are
diff --git a/crates/typst-layout/src/math/shared.rs b/crates/typst-layout/src/math/shared.rs
index 13477c10..74e62e8f 100644
--- a/crates/typst-layout/src/math/shared.rs
+++ b/crates/typst-layout/src/math/shared.rs
@@ -121,7 +121,6 @@ pub fn stack(
alternator: LeftRightAlternator,
minimum_ascent_descent: Option<(Abs, Abs)>,
) -> Frame {
- let rows: Vec<_> = rows.into_iter().flat_map(|r| r.rows()).collect();
let AlignmentResult { points, width } = alignments(&rows);
let rows: Vec<_> = rows
.into_iter()
diff --git a/crates/typst-layout/src/math/underover.rs b/crates/typst-layout/src/math/underover.rs
index b1d4825b..1a2c8db6 100644
--- a/crates/typst-layout/src/math/underover.rs
+++ b/crates/typst-layout/src/math/underover.rs
@@ -297,7 +297,7 @@ fn layout_underoverspreader(
if let Some(annotation) = annotation {
let under_style = style_for_subscript(styles);
let annotation_styles = styles.chain(&under_style);
- rows.push(ctx.layout_into_run(annotation, annotation_styles)?);
+ rows.extend(ctx.layout_into_run(annotation, annotation_styles)?.rows());
}
0
}
@@ -305,7 +305,7 @@ fn layout_underoverspreader(
if let Some(annotation) = annotation {
let over_style = style_for_superscript(styles);
let annotation_styles = styles.chain(&over_style);
- rows.push(ctx.layout_into_run(annotation, annotation_styles)?);
+ rows.extend(ctx.layout_into_run(annotation, annotation_styles)?.rows());
}
rows.push(stretched.into());
rows.push(MathRun::new(vec![body]));