From 62e967e10f445bb0faf03996ed5806e159898286 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 25 Nov 2024 23:15:56 +0100 Subject: [PATCH] Prepare for follow-on change --- experiments/2024-10-30/src/render/text.rs | 32 +++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/experiments/2024-10-30/src/render/text.rs b/experiments/2024-10-30/src/render/text.rs index 269b8cbfb..75595ae03 100644 --- a/experiments/2024-10-30/src/render/text.rs +++ b/experiments/2024-10-30/src/render/text.rs @@ -88,20 +88,24 @@ impl TextRenderer { buffers.push(buffer); } - let text_areas = buffers.iter().map(|buffer| glyphon::TextArea { - buffer, - left: 0., - top: 0., - scale: self.scale_factor, - bounds: glyphon::TextBounds { - left: 0, - top: 0, - right: surface_config.width as i32, - bottom: surface_config.height as i32, - }, - default_color: glyphon::Color::rgb(0, 0, 0), - custom_glyphs: &[], - }); + let mut text_areas = Vec::new(); + + for buffer in &buffers { + text_areas.push(glyphon::TextArea { + buffer, + left: 0., + top: 0., + scale: self.scale_factor, + bounds: glyphon::TextBounds { + left: 0, + top: 0, + right: surface_config.width as i32, + bottom: surface_config.height as i32, + }, + default_color: glyphon::Color::rgb(0, 0, 0), + custom_glyphs: &[], + }); + } self.text_renderer .prepare(