From 08072c41b4c0ec14a6ead70a904bd659cd681bdb Mon Sep 17 00:00:00 2001
From: StarArawn <toasterthegamer@gmail.com>
Date: Fri, 26 Nov 2021 10:24:13 -0500
Subject: [PATCH] Cleaned up some stuff.

---
 bevy_kayak_ui/src/render/unified/font/extract.rs | 2 --
 bevy_kayak_ui/src/render/unified/font/mod.rs     | 4 ----
 kayak_core/examples/test3.rs                     | 2 +-
 kayak_core/src/fragment.rs                       | 1 -
 kayak_core/src/widget_manager.rs                 | 7 ++++---
 kayak_font/src/contour.rs                        | 1 -
 kayak_render_macros/src/function_component.rs    | 1 -
 7 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/bevy_kayak_ui/src/render/unified/font/extract.rs b/bevy_kayak_ui/src/render/unified/font/extract.rs
index 877c688..689a82f 100644
--- a/bevy_kayak_ui/src/render/unified/font/extract.rs
+++ b/bevy_kayak_ui/src/render/unified/font/extract.rs
@@ -53,8 +53,6 @@ pub fn extract_texts(
         if new_chars.len() > 0 {
             let font = fonts.get_mut(font_handle.clone()).unwrap();
             for c in new_chars {
-                dbg!("Adding char: ");
-                dbg!(c);
                 font.font.add_character(c);
             }
         }
diff --git a/bevy_kayak_ui/src/render/unified/font/mod.rs b/bevy_kayak_ui/src/render/unified/font/mod.rs
index e356d38..6bb28ab 100644
--- a/bevy_kayak_ui/src/render/unified/font/mod.rs
+++ b/bevy_kayak_ui/src/render/unified/font/mod.rs
@@ -52,8 +52,6 @@ fn load_fonts(mut font_assets: ResMut<Assets<KayakFont>>, mut font_mapping: ResM
 
     let handle = font_assets.add(KayakFont { font });
     font_mapping.add(handle);
-
-    dbg!("Loaded base font!");
 }
 
 fn extract_fonts(
@@ -68,11 +66,9 @@ fn extract_fonts(
         match event {
             AssetEvent::Created { handle } => {
                 changed_assets.insert(handle);
-                dbg!("New font added!");
             }
             AssetEvent::Modified { handle } => {
                 changed_assets.insert(handle);
-                dbg!("Font changed!");
             }
             AssetEvent::Removed { handle } => {
                 if !changed_assets.remove(handle) {
diff --git a/kayak_core/examples/test3.rs b/kayak_core/examples/test3.rs
index 12c5683..5907f5b 100644
--- a/kayak_core/examples/test3.rs
+++ b/kayak_core/examples/test3.rs
@@ -24,7 +24,7 @@ fn MyWidget(context: &mut KayakContext, children: Children) {
 
 #[widget]
 fn MyWidget2(test: u32, children: Children) {
-    dbg!(test);
+    let _test = test;
     rsx! {
         <>
             {children}
diff --git a/kayak_core/src/fragment.rs b/kayak_core/src/fragment.rs
index 744e444..a94adc6 100644
--- a/kayak_core/src/fragment.rs
+++ b/kayak_core/src/fragment.rs
@@ -35,7 +35,6 @@ impl Widget for Fragment {
     }
 
     fn render(&mut self, context: &mut KayakContext) {
-        dbg!("Rendering fragment children!");
         if let Some(children) = self.children.as_ref() {
             children(Some(self.get_id()), context);
         }
diff --git a/kayak_core/src/widget_manager.rs b/kayak_core/src/widget_manager.rs
index f6792ba..3be622a 100644
--- a/kayak_core/src/widget_manager.rs
+++ b/kayak_core/src/widget_manager.rs
@@ -7,7 +7,7 @@ use crate::{
     tree::Tree,
     Arena, Index, Widget,
 };
-use as_any::Downcast;
+// use as_any::Downcast;
 
 #[derive(Debug)]
 pub struct WidgetManager {
@@ -66,6 +66,9 @@ impl WidgetManager {
                         self.dirty_nodes.remove(index);
                     }
 
+                    // TODO: Figure a good way of diffing props passed to children of a widget
+                    // that wont naturally-rerender it's children because of a lack of changes
+                    // to it's own props.
                     // if &widget
                     //     != self.current_widgets[*widget_id]
                     //         .as_ref()
@@ -75,12 +78,10 @@ impl WidgetManager {
                     // {
                     let boxed_widget: Box<dyn Widget> = Box::new(widget);
                     *self.current_widgets[*widget_id].as_mut().unwrap() = boxed_widget;
-                    dbg!("Widget changed!");
                     // Tell renderer that the nodes changed.
                     self.dirty_render_nodes.push(*widget_id);
                     return (true, *widget_id);
                     // } else {
-                    //     dbg!("No widget changes!");
                     //     return (false, *widget_id);
                     // }
                 }
diff --git a/kayak_font/src/contour.rs b/kayak_font/src/contour.rs
index c963de3..6b21056 100644
--- a/kayak_font/src/contour.rs
+++ b/kayak_font/src/contour.rs
@@ -75,7 +75,6 @@ pub fn rescale_contours(
     //     (new_width, new_height)
     // };
 
-    // dbg!(new_width, new_height);
 
     // let x_scale = new_width / initial_bounds.size.width;
     // let y_scale = new_height / initial_bounds.size.height;
diff --git a/kayak_render_macros/src/function_component.rs b/kayak_render_macros/src/function_component.rs
index 2ad9e3a..74ad5b7 100644
--- a/kayak_render_macros/src/function_component.rs
+++ b/kayak_render_macros/src/function_component.rs
@@ -164,7 +164,6 @@ pub fn create_function_component(f: syn::ItemFn) -> TokenStream {
             }
 
             fn render(&mut self, context: &mut ::kayak_core::context::KayakContext) {
-                // dbg!(stringify!(Rendering widget: #struct_name));
                 let parent_id = self.get_id();
                 context.set_current_id(parent_id);
                 let parent_id = Some(parent_id);
-- 
GitLab