1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 14:50:03 -04:00

Cache GlyphIds for allocation instead of full info

This commit is contained in:
valadaptive
2025-09-07 21:19:07 -04:00
parent 95458f4b52
commit 38fbae0541

View File

@@ -82,7 +82,7 @@ pub struct FontImpl {
tweak: FontTweak, tweak: FontTweak,
glyph_info_cache: ahash::HashMap<char, GlyphInfo>, glyph_info_cache: ahash::HashMap<char, GlyphInfo>,
glyph_alloc_cache: glyph_alloc_cache:
ahash::HashMap<(GlyphInfo, OrderedFloat<f32>, OrderedFloat<f32>), GlyphAllocation>, ahash::HashMap<(ab_glyph::GlyphId, OrderedFloat<f32>, OrderedFloat<f32>), GlyphAllocation>,
} }
trait FontExt { trait FontExt {
@@ -263,7 +263,7 @@ impl FontImpl {
}; };
let entry = match self.glyph_alloc_cache.entry(( let entry = match self.glyph_alloc_cache.entry((
glyph_info, glyph_id,
metrics.px_scale_factor.into(), metrics.px_scale_factor.into(),
metrics.pixels_per_point.into(), metrics.pixels_per_point.into(),
)) { )) {