From ec572a78d760794996e50653290ace7ee5ca9d2c Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Thu, 18 Dec 2025 09:56:06 -0600 Subject: [PATCH] remove some debugging an unnecessary allocating --- src/ui/presenter.rs | 5 ++--- src/ui/text_svg.rs | 35 +++++++++++++++++------------------ 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/ui/presenter.rs b/src/ui/presenter.rs index 243bb5f..e5300be 100644 --- a/src/ui/presenter.rs +++ b/src/ui/presenter.rs @@ -23,9 +23,8 @@ use cosmic::{ }, prelude::*, widget::{ - Container, Id, Row, Space, container, context_menu, - horizontal_space, icon, image, menu, mouse_area, responsive, - scrollable, text, + Container, Id, Row, Space, container, context_menu, image, + menu, mouse_area, responsive, scrollable, text, }, }; use iced_video_player::{Position, Video, VideoPlayer, gst_pbutils}; diff --git a/src/ui/text_svg.rs b/src/ui/text_svg.rs index 8e5bb9e..250ea44 100644 --- a/src/ui/text_svg.rs +++ b/src/ui/text_svg.rs @@ -14,7 +14,6 @@ use cosmic::{ prelude::*, widget::{Image, image::Handle}, }; -use rapidhash::v3::rapidhash_v3; use resvg::{ tiny_skia::{self, Pixmap}, usvg::{Tree, fontdb}, @@ -251,9 +250,9 @@ impl TextSvg { pub fn build(mut self) -> Self { // debug!("starting..."); - let mut path = dirs::data_local_dir().unwrap(); - path.push(PathBuf::from("lumina")); - path.push(PathBuf::from("temp")); + // let mut path = dirs::data_local_dir().unwrap(); + // path.push(PathBuf::from("lumina")); + // path.push(PathBuf::from("temp")); let shadow = if let Some(shadow) = &self.shadow { format!( @@ -313,18 +312,18 @@ impl TextSvg { text ); - let hashed_title = rapidhash_v3(final_svg.as_bytes()); - path.push(PathBuf::from(hashed_title.to_string())); - path.set_extension("png"); + // let hashed_title = rapidhash_v3(final_svg.as_bytes()); + // path.push(PathBuf::from(hashed_title.to_string())); + // path.set_extension("png"); - if path.exists() { - // debug!("cached"); - let handle = Handle::from_path(path); - self.handle = Some(handle); - return self; - } + // if path.exists() { + // // debug!("cached"); + // let handle = Handle::from_path(path); + // self.handle = Some(handle); + // return self; + // } - debug!("text string built..."); + // debug!("text string built..."); let resvg_tree = Tree::from_data( final_svg.as_bytes(), &resvg::usvg::Options { @@ -333,16 +332,16 @@ impl TextSvg { }, ) .expect("Woops mama"); - debug!("parsed"); + // debug!("parsed"); let transform = tiny_skia::Transform::default(); let mut pixmap = Pixmap::new(size.width as u32, size.height as u32) .expect("opops"); resvg::render(&resvg_tree, transform, &mut pixmap.as_mut()); - debug!("rendered"); + // debug!("rendered"); // let _ = pixmap.save_png(&path); - debug!("saved"); + // debug!("saved"); // let handle = Handle::from_path(path); let handle = Handle::from_rgba( size.width as u32, @@ -350,7 +349,7 @@ impl TextSvg { pixmap.take(), ); self.handle = Some(handle); - debug!("stored"); + // debug!("stored"); self }