diff options
| author | sitandr <60141933+sitandr@users.noreply.github.com> | 2023-05-19 16:33:15 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-19 15:33:15 +0200 |
| commit | 42c3a6fa72be91c115e28e3866012b95b4d63cf4 (patch) | |
| tree | dd147f27466bffbc0d7498e6d55181702967c643 /library/src/math/stretch.rs | |
| parent | 84b9d9c9906a2f39718b6b19e40c9f5f200d7f96 (diff) | |
Fixed symbol style reset in stretching (#1195)
Diffstat (limited to 'library/src/math/stretch.rs')
| -rw-r--r-- | library/src/math/stretch.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/library/src/math/stretch.rs b/library/src/math/stretch.rs index bb454022..bbb0c9c4 100644 --- a/library/src/math/stretch.rs +++ b/library/src/math/stretch.rs @@ -33,7 +33,7 @@ impl GlyphFragment { /// The resulting frame may not have the exact desired width. fn stretch_glyph( ctx: &MathContext, - base: GlyphFragment, + mut base: GlyphFragment, target: Abs, short_fall: Abs, horizontal: bool, @@ -73,7 +73,8 @@ fn stretch_glyph( // This is either good or the best we've got. if short_target <= best_advance || construction.assembly.is_none() { - return GlyphFragment::with_id(ctx, base.c, best_id, base.span).into_variant(); + base.set_id(ctx, best_id); + return base.into_variant(); } // Assemble from parts. @@ -142,7 +143,8 @@ fn assemble( advance += ratio * (max_overlap - min_overlap); } - let fragment = GlyphFragment::with_id(ctx, base.c, part.glyph_id, base.span); + let mut fragment = base.clone(); + fragment.set_id(ctx, part.glyph_id); selected.push((fragment, advance)); } |
