From 53e39884fcbf758c3716312bf05301f3edc98a7c Mon Sep 17 00:00:00 2001 From: haven <54509200+Haven-King@users.noreply.github.com> Date: Thu, 8 Oct 2026 20:25:56 -0700 Subject: [PATCH] M7: Auto Size measures vertically aligned area type from the top auto_height lays the text out in a very tall probe frame; with Center, Bottom or Justify the lines moved down inside it and the frame grew to tens of thousands of points. --- crates/engine/src/cmd/typecmd.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/engine/src/cmd/typecmd.rs b/crates/engine/src/cmd/typecmd.rs index 392f1d80e..f51db4bec 100644 --- a/crates/engine/src/cmd/typecmd.rs +++ b/crates/engine/src/cmd/typecmd.rs @@ -147,6 +147,8 @@ fn auto_height(t: &mut TextObject) -> bool { let col_w = if cols > 1 { ((b.width() - t.area.gutter.max(0.0) * (cols - 1) as f64) / cols as f64).max(1.0) } else { b.width() }; with_size(&mut probe, col_w, tall); probe.area.columns = 1; + // Measured from the top: aligned in the tall probe the lines would sit far below. + probe.area.vertical_align = vectorcraft_doc::VerticalAlign::Top; let lay = vectorcraft_text::layout(db, &probe); let inset = t.area.inset.max(0.0); let Some(bottom) = lay.lines.iter().map(|l| l.baseline + l.descent).filter(|y| y.is_finite()).reduce(f64::max) else { return false };