From a113907005585aced3a4289302b58a02a50dee32 Mon Sep 17 00:00:00 2001 From: valadaptive Date: Sat, 5 Jul 2025 06:10:23 -0400 Subject: [PATCH] Include pixels_per_point in galley cache key --- crates/epaint/src/text/fonts.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/epaint/src/text/fonts.rs b/crates/epaint/src/text/fonts.rs index 3dd52efa0..0f2fef216 100644 --- a/crates/epaint/src/text/fonts.rs +++ b/crates/epaint/src/text/fonts.rs @@ -13,7 +13,7 @@ use crate::{ font::{Font, FontImpl, GlyphInfo}, }, }; -use emath::NumExt as _; +use emath::{NumExt as _, OrderedFloat}; #[cfg(feature = "default_fonts")] use epaint_default_fonts::{EMOJI_ICON, HACK_REGULAR, NOTO_EMOJI_REGULAR, UBUNTU_LIGHT}; @@ -872,7 +872,7 @@ impl GalleyCache { job.wrap.max_width = job.wrap.max_width.round(); } - let hash = crate::util::hash(&job); // TODO(emilk): even faster hasher? + let hash = crate::util::hash((&job, OrderedFloat(pixels_per_point))); // TODO(emilk): even faster hasher? let galley = match self.cache.entry(hash) { std::collections::hash_map::Entry::Occupied(entry) => {