diff --git a/crates/epaint/src/text/font.rs b/crates/epaint/src/text/font.rs index ea552b525..2cace035b 100644 --- a/crates/epaint/src/text/font.rs +++ b/crates/epaint/src/text/font.rs @@ -81,7 +81,8 @@ pub struct FontImpl { ab_glyph_font: ab_glyph::FontArc, tweak: FontTweak, glyph_info_cache: ahash::HashMap, - glyph_alloc_cache: ahash::HashMap<(GlyphInfo, OrderedFloat), GlyphAllocation>, + glyph_alloc_cache: + ahash::HashMap<(GlyphInfo, OrderedFloat, OrderedFloat), GlyphAllocation>, } trait FontExt { @@ -264,7 +265,11 @@ impl FontImpl { .ab_glyph_font .pt_scale_factor(font_size * self.tweak.scale * pixels_per_point) .round(); - let entry = match self.glyph_alloc_cache.entry((glyph_info, scale.into())) { + let entry = match self.glyph_alloc_cache.entry(( + glyph_info, + font_size.into(), + pixels_per_point.into(), + )) { std::collections::hash_map::Entry::Occupied(glyph_alloc) => { return *glyph_alloc.get(); }