From 1e68772e91d74737b9581f7153fbeb8cf1503e3f Mon Sep 17 00:00:00 2001 From: Shark Date: Tue, 10 Sep 2024 04:31:49 +0200 Subject: [PATCH] remove some debugging --- crates/gosub_taffy/src/compute/inline.rs | 63 ++---------------------- 1 file changed, 3 insertions(+), 60 deletions(-) diff --git a/crates/gosub_taffy/src/compute/inline.rs b/crates/gosub_taffy/src/compute/inline.rs index 9272da0ab..e26a20fb3 100644 --- a/crates/gosub_taffy/src/compute/inline.rs +++ b/crates/gosub_taffy/src/compute/inline.rs @@ -93,21 +93,17 @@ pub fn compute_inline_layout>( id: node_id, }); } else { - if u64::from(node_id) == 477u64 { - println!("inline_box : {:?}", node_id); - } - let out = tree.compute_child_layout(node_id, layout_input); tree.update_style(*child); let size = if let Some(cache) = tree.0.get_cache(*child) { - if cache.display == Display::InlineBlock { + if cache.display == Display::Inline { //TODO: handle margins here - out.size - } else { out.content_size + } else { + out.size } } else { out.content_size @@ -141,8 +137,6 @@ pub fn compute_inline_layout>( let mut align = Alignment::default(); if let Some(default) = text_node_data.first() { - println!("default: {:?}", default); - builder.push_default(&StyleProperty::FontStack(FontStack::Source( &default.font_family, ))); @@ -219,54 +213,10 @@ pub fn compute_inline_layout>( AvailableSpace::MaxContent => None, }; - println!("max_width: {:?}, ID: {:?}", max_width, nod_id.into()); - layout.break_all_lines(max_width); - let num_lines = layout.lines().count(); - - println!("num_lines: {:?}", num_lines); - layout.align(max_width, align); - // - // for (child, out) in children.into_iter().zip(outputs.into_iter()) { - - // let node_id = NodeId::from(child.into()); - // - // let style = tree.get_style(node_id); - // - // let location = Point { - // x: width, - // y: height - out.size.height, - // }; - // - // let border = style.border.resolve_or_zero(layout_input.parent_size); - // let padding = style.padding.resolve_or_zero(layout_input.parent_size); - // - // width += out.size.width + border.left + border.right + padding.left + padding.right; - // - // tree.set_unrounded_layout( - // node_id, - // &Layout { - // size: out.size, - // content_size: out.content_size, - // order: 0, - // location, - // border, - // padding, - // scrollbar_size: Size::ZERO, //TODO - // }, - // ); - // } - - println!( - "size: height: {} width: {}", - layout.height().ceil(), - layout.width().ceil() - ); - println!("text: {}", str_buf); - let content_size = Size { width: layout.width().ceil(), height: layout.height().ceil(), @@ -388,10 +338,6 @@ pub fn compute_inline_layout>( PositionedLayoutItem::InlineBox(inline_box) => { let id = NodeId::from(inline_box.id); - if inline_box.id == 137 { - println!("inline_box: {:?}", inline_box); - } - let size = Size { width: inline_box.width, height: inline_box.height, @@ -417,9 +363,6 @@ pub fn compute_inline_layout>( } } - println!("content_size: {:?}", content_size); - println!("layout h: {:?} w {:?}", layout.height(), layout.width()); - let mut size = content_size; if let AvailableSpace::Definite(width) = layout_input.available_space.width {