Skip to content

Commit

Permalink
remove some debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharktheone committed Sep 10, 2024
1 parent 596c66d commit 1e68772
Showing 1 changed file with 3 additions and 60 deletions.
63 changes: 3 additions & 60 deletions crates/gosub_taffy/src/compute/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,17 @@ pub fn compute_inline_layout<LT: LayoutTree<TaffyLayouter>>(
id: node_id,
});
} else {
if u64::from(node_id) == 477u64 {
println!("inline_box <a>: {:?}", 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
Expand Down Expand Up @@ -141,8 +137,6 @@ pub fn compute_inline_layout<LT: LayoutTree<TaffyLayouter>>(
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,
)));
Expand Down Expand Up @@ -219,54 +213,10 @@ pub fn compute_inline_layout<LT: LayoutTree<TaffyLayouter>>(
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(),
Expand Down Expand Up @@ -388,10 +338,6 @@ pub fn compute_inline_layout<LT: LayoutTree<TaffyLayouter>>(
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,
Expand All @@ -417,9 +363,6 @@ pub fn compute_inline_layout<LT: LayoutTree<TaffyLayouter>>(
}
}

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 {
Expand Down

0 comments on commit 1e68772

Please sign in to comment.