From 38fbae054124f52ce856441350445e98a0c7df62 Mon Sep 17 00:00:00 2001 From: valadaptive Date: Sun, 7 Sep 2025 21:19:07 -0400 Subject: [PATCH] Cache GlyphIds for allocation instead of full info --- crates/epaint/src/text/font.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/epaint/src/text/font.rs b/crates/epaint/src/text/font.rs index f07fc98e7..51cd88024 100644 --- a/crates/epaint/src/text/font.rs +++ b/crates/epaint/src/text/font.rs @@ -82,7 +82,7 @@ pub struct FontImpl { tweak: FontTweak, glyph_info_cache: ahash::HashMap, glyph_alloc_cache: - ahash::HashMap<(GlyphInfo, OrderedFloat, OrderedFloat), GlyphAllocation>, + ahash::HashMap<(ab_glyph::GlyphId, OrderedFloat, OrderedFloat), GlyphAllocation>, } trait FontExt { @@ -263,7 +263,7 @@ impl FontImpl { }; let entry = match self.glyph_alloc_cache.entry(( - glyph_info, + glyph_id, metrics.px_scale_factor.into(), metrics.pixels_per_point.into(), )) {