diff options
author | 2023-08-30 05:06:08 +0200 | |
---|---|---|
committer | 2023-08-30 05:06:08 +0200 | |
commit | 89acf0217e0acd92a82bff1fd516cd4266c0878a (patch) | |
tree | 7ed80675520b67c02e1a171a2131100281d7c5d7 /tiny_skia | |
parent | ed3454301e663a7cb7d73cd56b57b188f4d14a2f (diff) | |
download | iced-89acf0217e0acd92a82bff1fd516cd4266c0878a.tar.gz iced-89acf0217e0acd92a82bff1fd516cd4266c0878a.tar.bz2 iced-89acf0217e0acd92a82bff1fd516cd4266c0878a.zip |
Use `min_bounds` for cached text
Diffstat (limited to 'tiny_skia')
-rw-r--r-- | tiny_skia/src/text.rs | 8 |
1 files changed, 4 insertions, 4 deletions
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); |