mirror of
https://github.com/typst/typst
synced 2025-08-24 03:34:14 +08:00
Move glyph reset to stretch function
This commit is contained in:
parent
9b1be3bd82
commit
3b2bb9bbcc
@ -437,6 +437,8 @@ impl GlyphFragment {
|
||||
///
|
||||
/// The resulting frame may not have the exact desired width or height.
|
||||
pub fn stretch(&mut self, ctx: &mut MathContext, target: 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 {
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user