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 15, 2024
1 parent 503c4fb commit 49f9fce
Showing 1 changed file with 1 addition and 58 deletions.
59 changes: 1 addition & 58 deletions crates/gosub_taffy/src/compute/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,12 @@ pub fn compute_inline_layout<LT: LayoutTree<TaffyLayouter>>(
id: node_id,
});
} else {
if u64::from(node_id) == 22u64 {
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.content_size
Expand Down Expand Up @@ -143,8 +139,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 @@ -221,54 +215,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 @@ -391,10 +341,6 @@ pub fn compute_inline_layout<LT: LayoutTree<TaffyLayouter>>(
PositionedLayoutItem::InlineBox(inline_box) => {
let id = NodeId::from(inline_box.id);

if inline_box.id == 162 {
println!("inline_box: {:?}", inline_box);
}

let size = Size {
width: inline_box.width,
height: inline_box.height,
Expand All @@ -420,9 +366,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 49f9fce

Please sign in to comment.