From 8c709d97d1d937b18b0f4aed6723250a18935491 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Thu, 23 Oct 2025 10:34:07 -0500 Subject: [PATCH] remove the caching of text_svg Since the longest part of the algorithm is saving and reloading the data this speeds up the entire process. Next we can make sure every slide's text gets made and added individually such that they can be made one at a time and see the changes nearly instant --- src/ui/text_svg.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/ui/text_svg.rs b/src/ui/text_svg.rs index 07b0e9a..8e5bb9e 100644 --- a/src/ui/text_svg.rs +++ b/src/ui/text_svg.rs @@ -339,15 +339,16 @@ impl TextSvg { Pixmap::new(size.width as u32, size.height as u32) .expect("opops"); resvg::render(&resvg_tree, transform, &mut pixmap.as_mut()); - let _ = pixmap.save_png(&path); - debug!("rendered"); - let handle = Handle::from_path(path); - // let handle = Handle::from_rgba( - // size.width as u32, - // size.height as u32, - // pixmap.take(), - // ); + // let _ = pixmap.save_png(&path); + + debug!("saved"); + // let handle = Handle::from_path(path); + let handle = Handle::from_rgba( + size.width as u32, + size.height as u32, + pixmap.take(), + ); self.handle = Some(handle); debug!("stored"); self