From 78ad365db232e53cbdf12105e40c1dbe87a3238c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 28 Jun 2023 00:35:37 +0200 Subject: Reuse entries in `text::Cache` in `iced_wgpu` --- tiny_skia/src/text.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tiny_skia/src/text.rs') diff --git a/tiny_skia/src/text.rs b/tiny_skia/src/text.rs index 3441da8f..4f89ef52 100644 --- a/tiny_skia/src/text.rs +++ b/tiny_skia/src/text.rs @@ -138,7 +138,7 @@ impl Pipeline { font: Font, bounds: Size, shaping: Shaping, - ) -> (f32, f32) { + ) -> Size { let mut measurement_cache = self.cache.borrow_mut(); let line_height = f32::from(line_height.to_absolute(Pixels(size))); @@ -162,7 +162,7 @@ impl Pipeline { (i + 1, buffer.line_w.max(max)) }); - (max_width, line_height * total_lines as f32) + Size::new(max_width, line_height * total_lines as f32) } pub fn hit_test( -- cgit