Przeglądaj źródła

Remove some debugging information.

Kestrel 3 miesięcy temu
rodzic
commit
97b26ff0c2
3 zmienionych plików z 5 dodań i 9 usunięć
  1. 4 0
      src/layout.rs
  2. 0 8
      src/layout/arr.rs
  3. 1 1
      src/widget/frame.rs

+ 4 - 0
src/layout.rs

@@ -286,6 +286,10 @@ impl LayoutNode {
     pub fn render_needed(&self) {
         self.cache.render_queue.borrow_mut().push(self.cache_key);
     }
+
+    pub fn make_new_node(&self) -> Self {
+        Self::new(self.cache.clone())
+    }
 }
 
 /// Accessors

+ 0 - 8
src/layout/arr.rs

@@ -25,13 +25,6 @@ fn do_align(node: &LayoutNodeAccess, mut inside: PixelBox) -> PixelBox {
     let net_policy = node
         .with_state(|ns| ns.net_policy)
         .expect("do_align invoked with node that has no net_policy");
-    println!("do_align | net: {net_policy:?}");
-    println!(
-        "         | alignments: {:?} {:?}",
-        node.halign(),
-        node.valign()
-    );
-    println!("         | inside before: {inside:?}");
     if net_policy.width.slack_weight == 0 {
         let slack = (inside.width() - net_policy.width.desired as i32).max(0);
         let hshrink = match node.halign() {
@@ -54,7 +47,6 @@ fn do_align(node: &LayoutNodeAccess, mut inside: PixelBox) -> PixelBox {
         };
         inside = inside.inner_box(vshrink);
     }
-    println!("         | inside after:  {inside:?}");
     inside
 }
 

+ 1 - 1
src/widget/frame.rs

@@ -36,7 +36,7 @@ impl<C: Component> Frame<C> {
     }
 
     pub fn wrap_widget<W: 'static + Widget<C>>(child: W) -> Self {
-        let mut nnode = LayoutNode::new(child.layout_node().cache().clone());
+        let mut nnode = child.layout_node().make_new_node();
         nnode
             .set_arrangement(ChildArrangement::Container)
             .set_height_policy(SizePolicy::expanding(1))