From 89acf0217e0acd92a82bff1fd516cd4266c0878a Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 30 Aug 2023 05:06:08 +0200 Subject: Use `min_bounds` for cached text --- tiny_skia/src/text.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tiny_skia') diff --git a/tiny_skia/src/text.rs b/tiny_skia/src/text.rs index e4c5ad9b..6047a826 100644 --- a/tiny_skia/src/text.rs +++ b/tiny_skia/src/text.rs @@ -77,10 +77,10 @@ impl Pipeline { shaping, }; - let (_, buffer) = self.cache.get_mut().allocate(font_system, key); + let (_, entry) = self.cache.get_mut().allocate(font_system, key); - let max_width = bounds.width * scale_factor; - let total_height = bounds.height * scale_factor; + let max_width = entry.min_bounds.width * scale_factor; + let total_height = entry.min_bounds.height * scale_factor; let bounds = bounds * scale_factor; @@ -98,7 +98,7 @@ impl Pipeline { let mut swash = cosmic_text::SwashCache::new(); - for run in buffer.layout_runs() { + for run in entry.buffer.layout_runs() { for glyph in run.glyphs { let physical_glyph = glyph.physical((x, y), scale_factor); -- cgit