From b00c64ccc2e3ff77cb89012febdd8099e34a257e Mon Sep 17 00:00:00 2001 From: mkorje Date: Sun, 1 Jun 2025 16:18:54 +1000 Subject: [PATCH] Move glyph reset to stretch function --- crates/typst-layout/src/math/fragment.rs | 2 ++ crates/typst-layout/src/math/stretch.rs | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/typst-layout/src/math/fragment.rs b/crates/typst-layout/src/math/fragment.rs index e1912d366..738ffdc35 100644 --- a/crates/typst-layout/src/math/fragment.rs +++ b/crates/typst-layout/src/math/fragment.rs @@ -448,6 +448,8 @@ impl GlyphFragment { short_fall: Abs, axis: Axis, ) { + self.reset_glyph(); + // If the base glyph is good enough, use it. let mut advance = self.size.get(axis); if axis == Axis::X && !self.extended_shape { diff --git a/crates/typst-layout/src/math/stretch.rs b/crates/typst-layout/src/math/stretch.rs index 7e6ab089a..d58540367 100644 --- a/crates/typst-layout/src/math/stretch.rs +++ b/crates/typst-layout/src/math/stretch.rs @@ -60,8 +60,6 @@ pub fn stretch_fragment( } }; - glyph.reset_glyph(); - let relative_to_size = relative_to.unwrap_or_else(|| size.get(stretch_axis)); glyph.stretch(ctx, stretch.relative_to(relative_to_size), short_fall, stretch_axis);