Skip to content
Snippets Groups Projects
Commit 08072c41 authored by StarArawn's avatar StarArawn
Browse files

Cleaned up some stuff.

parent 60d6f92e
No related branches found
No related tags found
No related merge requests found
...@@ -53,8 +53,6 @@ pub fn extract_texts( ...@@ -53,8 +53,6 @@ pub fn extract_texts(
if new_chars.len() > 0 { if new_chars.len() > 0 {
let font = fonts.get_mut(font_handle.clone()).unwrap(); let font = fonts.get_mut(font_handle.clone()).unwrap();
for c in new_chars { for c in new_chars {
dbg!("Adding char: ");
dbg!(c);
font.font.add_character(c); font.font.add_character(c);
} }
} }
......
...@@ -52,8 +52,6 @@ fn load_fonts(mut font_assets: ResMut<Assets<KayakFont>>, mut font_mapping: ResM ...@@ -52,8 +52,6 @@ fn load_fonts(mut font_assets: ResMut<Assets<KayakFont>>, mut font_mapping: ResM
let handle = font_assets.add(KayakFont { font }); let handle = font_assets.add(KayakFont { font });
font_mapping.add(handle); font_mapping.add(handle);
dbg!("Loaded base font!");
} }
fn extract_fonts( fn extract_fonts(
...@@ -68,11 +66,9 @@ fn extract_fonts( ...@@ -68,11 +66,9 @@ fn extract_fonts(
match event { match event {
AssetEvent::Created { handle } => { AssetEvent::Created { handle } => {
changed_assets.insert(handle); changed_assets.insert(handle);
dbg!("New font added!");
} }
AssetEvent::Modified { handle } => { AssetEvent::Modified { handle } => {
changed_assets.insert(handle); changed_assets.insert(handle);
dbg!("Font changed!");
} }
AssetEvent::Removed { handle } => { AssetEvent::Removed { handle } => {
if !changed_assets.remove(handle) { if !changed_assets.remove(handle) {
......
...@@ -24,7 +24,7 @@ fn MyWidget(context: &mut KayakContext, children: Children) { ...@@ -24,7 +24,7 @@ fn MyWidget(context: &mut KayakContext, children: Children) {
#[widget] #[widget]
fn MyWidget2(test: u32, children: Children) { fn MyWidget2(test: u32, children: Children) {
dbg!(test); let _test = test;
rsx! { rsx! {
<> <>
{children} {children}
......
...@@ -35,7 +35,6 @@ impl Widget for Fragment { ...@@ -35,7 +35,6 @@ impl Widget for Fragment {
} }
fn render(&mut self, context: &mut KayakContext) { fn render(&mut self, context: &mut KayakContext) {
dbg!("Rendering fragment children!");
if let Some(children) = self.children.as_ref() { if let Some(children) = self.children.as_ref() {
children(Some(self.get_id()), context); children(Some(self.get_id()), context);
} }
......
...@@ -7,7 +7,7 @@ use crate::{ ...@@ -7,7 +7,7 @@ use crate::{
tree::Tree, tree::Tree,
Arena, Index, Widget, Arena, Index, Widget,
}; };
use as_any::Downcast; // use as_any::Downcast;
#[derive(Debug)] #[derive(Debug)]
pub struct WidgetManager { pub struct WidgetManager {
...@@ -66,6 +66,9 @@ impl WidgetManager { ...@@ -66,6 +66,9 @@ impl WidgetManager {
self.dirty_nodes.remove(index); 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 // if &widget
// != self.current_widgets[*widget_id] // != self.current_widgets[*widget_id]
// .as_ref() // .as_ref()
...@@ -75,12 +78,10 @@ impl WidgetManager { ...@@ -75,12 +78,10 @@ impl WidgetManager {
// { // {
let boxed_widget: Box<dyn Widget> = Box::new(widget); let boxed_widget: Box<dyn Widget> = Box::new(widget);
*self.current_widgets[*widget_id].as_mut().unwrap() = boxed_widget; *self.current_widgets[*widget_id].as_mut().unwrap() = boxed_widget;
dbg!("Widget changed!");
// Tell renderer that the nodes changed. // Tell renderer that the nodes changed.
self.dirty_render_nodes.push(*widget_id); self.dirty_render_nodes.push(*widget_id);
return (true, *widget_id); return (true, *widget_id);
// } else { // } else {
// dbg!("No widget changes!");
// return (false, *widget_id); // return (false, *widget_id);
// } // }
} }
......
...@@ -75,7 +75,6 @@ pub fn rescale_contours( ...@@ -75,7 +75,6 @@ pub fn rescale_contours(
// (new_width, new_height) // (new_width, new_height)
// }; // };
// dbg!(new_width, new_height);
// let x_scale = new_width / initial_bounds.size.width; // let x_scale = new_width / initial_bounds.size.width;
// let y_scale = new_height / initial_bounds.size.height; // let y_scale = new_height / initial_bounds.size.height;
......
...@@ -164,7 +164,6 @@ pub fn create_function_component(f: syn::ItemFn) -> TokenStream { ...@@ -164,7 +164,6 @@ pub fn create_function_component(f: syn::ItemFn) -> TokenStream {
} }
fn render(&mut self, context: &mut ::kayak_core::context::KayakContext) { fn render(&mut self, context: &mut ::kayak_core::context::KayakContext) {
// dbg!(stringify!(Rendering widget: #struct_name));
let parent_id = self.get_id(); let parent_id = self.get_id();
context.set_current_id(parent_id); context.set_current_id(parent_id);
let parent_id = Some(parent_id); let parent_id = Some(parent_id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment