diff --git a/README.md b/README.md index d6e8cb8d0..9459adbab 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ let mut taffy = Taffy::new(); let header_node = taffy .new_leaf( Style { - size: Size { width: Dimension::Points(800.0), height: Dimension::Points(100.0) }, + size: Size { width: points(800.0), height: points(100.0) }, ..Default::default() }, ).unwrap(); @@ -36,7 +36,7 @@ let header_node = taffy let body_node = taffy .new_leaf( Style { - size: Size { width: Dimension::Points(800.0), height: Dimension::Undefined }, + size: Size { width: points(800.0), height: auto() }, flex_grow: 1.0, ..Default::default() }, @@ -46,7 +46,7 @@ let root_node = taffy .new_with_children( Style { flex_direction: FlexDirection::Column, - size: Size { width: Dimension::Points(800.0), height: Dimension::Points(600.0) }, + size: Size { width: points(800.0), height: points(600.0) }, ..Default::default() }, &[header_node, body_node], diff --git a/benches/generated/absolute_layout_align_items_and_justify_content_center.rs b/benches/generated/absolute_layout_align_items_and_justify_content_center.rs index 02e99e266..ca0e219b1 100644 --- a/benches/generated/absolute_layout_align_items_and_justify_content_center.rs +++ b/benches/generated/absolute_layout_align_items_and_justify_content_center.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,7 +24,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_align_items_and_justify_content_center_and_bottom_position.rs b/benches/generated/absolute_layout_align_items_and_justify_content_center_and_bottom_position.rs index 8b53f95ed..242e323e2 100644 --- a/benches/generated/absolute_layout_align_items_and_justify_content_center_and_bottom_position.rs +++ b/benches/generated/absolute_layout_align_items_and_justify_content_center_and_bottom_position.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,11 +9,11 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() }, ..Default::default() }, @@ -26,7 +28,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_align_items_and_justify_content_center_and_left_position.rs b/benches/generated/absolute_layout_align_items_and_justify_content_center_and_left_position.rs index 6a5b02e61..2c6d7ec03 100644 --- a/benches/generated/absolute_layout_align_items_and_justify_content_center_and_left_position.rs +++ b/benches/generated/absolute_layout_align_items_and_justify_content_center_and_left_position.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() + }, + position: taffy::geometry::Rect { + left: taffy::style::LengthPercentageAuto::Points(5f32), + ..Rect::auto() }, - position: taffy::geometry::Rect { left: taffy::style::Dimension::Points(5f32), ..Default::default() }, ..Default::default() }, &[], @@ -23,7 +28,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_align_items_and_justify_content_center_and_right_position.rs b/benches/generated/absolute_layout_align_items_and_justify_content_center_and_right_position.rs index 033bf3880..978a31491 100644 --- a/benches/generated/absolute_layout_align_items_and_justify_content_center_and_right_position.rs +++ b/benches/generated/absolute_layout_align_items_and_justify_content_center_and_right_position.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() + }, + position: taffy::geometry::Rect { + right: taffy::style::LengthPercentageAuto::Points(5f32), + ..Rect::auto() }, - position: taffy::geometry::Rect { right: taffy::style::Dimension::Points(5f32), ..Default::default() }, ..Default::default() }, &[], @@ -23,7 +28,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_align_items_and_justify_content_center_and_top_position.rs b/benches/generated/absolute_layout_align_items_and_justify_content_center_and_top_position.rs index 5774fc8a4..1ada06afd 100644 --- a/benches/generated/absolute_layout_align_items_and_justify_content_center_and_top_position.rs +++ b/benches/generated/absolute_layout_align_items_and_justify_content_center_and_top_position.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() + }, + position: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() }, - position: taffy::geometry::Rect { top: taffy::style::Dimension::Points(10f32), ..Default::default() }, ..Default::default() }, &[], @@ -23,7 +28,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_align_items_and_justify_content_flex_end.rs b/benches/generated/absolute_layout_align_items_and_justify_content_flex_end.rs index 519b2712b..0b23cd809 100644 --- a/benches/generated/absolute_layout_align_items_and_justify_content_flex_end.rs +++ b/benches/generated/absolute_layout_align_items_and_justify_content_flex_end.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,7 +24,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_align_items_center.rs b/benches/generated/absolute_layout_align_items_center.rs index 42a47b704..db9f4f27a 100644 --- a/benches/generated/absolute_layout_align_items_center.rs +++ b/benches/generated/absolute_layout_align_items_center.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_align_items_center_on_child_only.rs b/benches/generated/absolute_layout_align_items_center_on_child_only.rs index 8c66a015f..0d3b0802b 100644 --- a/benches/generated/absolute_layout_align_items_center_on_child_only.rs +++ b/benches/generated/absolute_layout_align_items_center_on_child_only.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_child_order.rs b/benches/generated/absolute_layout_child_order.rs index 1d6cd9236..b7c80ad35 100644 --- a/benches/generated/absolute_layout_child_order.rs +++ b/benches/generated/absolute_layout_child_order.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -48,7 +50,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_in_wrap_reverse_column_container.rs b/benches/generated/absolute_layout_in_wrap_reverse_column_container.rs index f41ac919a..8c77b85c6 100644 --- a/benches/generated/absolute_layout_in_wrap_reverse_column_container.rs +++ b/benches/generated/absolute_layout_in_wrap_reverse_column_container.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,7 +24,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_in_wrap_reverse_column_container_flex_end.rs b/benches/generated/absolute_layout_in_wrap_reverse_column_container_flex_end.rs index 57d00f435..eae4f47f2 100644 --- a/benches/generated/absolute_layout_in_wrap_reverse_column_container_flex_end.rs +++ b/benches/generated/absolute_layout_in_wrap_reverse_column_container_flex_end.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -23,7 +25,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_in_wrap_reverse_row_container.rs b/benches/generated/absolute_layout_in_wrap_reverse_row_container.rs index 62ec02944..72dcea73b 100644 --- a/benches/generated/absolute_layout_in_wrap_reverse_row_container.rs +++ b/benches/generated/absolute_layout_in_wrap_reverse_row_container.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_in_wrap_reverse_row_container_flex_end.rs b/benches/generated/absolute_layout_in_wrap_reverse_row_container_flex_end.rs index 93257439f..df41760ba 100644 --- a/benches/generated/absolute_layout_in_wrap_reverse_row_container_flex_end.rs +++ b/benches/generated/absolute_layout_in_wrap_reverse_row_container_flex_end.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,7 +24,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_justify_content_center.rs b/benches/generated/absolute_layout_justify_content_center.rs index e690c852f..61dfeaa5f 100644 --- a/benches/generated/absolute_layout_justify_content_center.rs +++ b/benches/generated/absolute_layout_justify_content_center.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_no_size.rs b/benches/generated/absolute_layout_no_size.rs index 620baaae6..aa115adc9 100644 --- a/benches/generated/absolute_layout_no_size.rs +++ b/benches/generated/absolute_layout_no_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -12,7 +14,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_percentage_bottom_based_on_parent_height.rs b/benches/generated/absolute_layout_percentage_bottom_based_on_parent_height.rs index 19cea211c..4d2e80540 100644 --- a/benches/generated/absolute_layout_percentage_bottom_based_on_parent_height.rs +++ b/benches/generated/absolute_layout_percentage_bottom_based_on_parent_height.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() + }, + position: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Percent(0.5f32), + ..Rect::auto() }, - position: taffy::geometry::Rect { top: taffy::style::Dimension::Percent(0.5f32), ..Default::default() }, ..Default::default() }, &[], @@ -22,11 +27,11 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - bottom: taffy::style::Dimension::Percent(0.5f32), - ..Default::default() + bottom: taffy::style::LengthPercentageAuto::Percent(0.5f32), + ..Rect::auto() }, ..Default::default() }, @@ -37,11 +42,11 @@ pub fn compute() { .new_with_children( taffy::style::Style { position_type: taffy::style::PositionType::Absolute, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, position: taffy::geometry::Rect { - top: taffy::style::Dimension::Percent(0.1f32), - bottom: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Percent(0.1f32), + bottom: taffy::style::LengthPercentageAuto::Percent(0.1f32), + ..Rect::auto() }, ..Default::default() }, @@ -54,7 +59,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_start_top_end_bottom.rs b/benches/generated/absolute_layout_start_top_end_bottom.rs index 31ad9203e..27d290fae 100644 --- a/benches/generated/absolute_layout_start_top_end_bottom.rs +++ b/benches/generated/absolute_layout_start_top_end_bottom.rs @@ -1,15 +1,17 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { position_type: taffy::style::PositionType::Absolute, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() }, ..Default::default() }, @@ -22,7 +24,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_width_height_end_bottom.rs b/benches/generated/absolute_layout_width_height_end_bottom.rs index 6644673f9..a7df966c1 100644 --- a/benches/generated/absolute_layout_width_height_end_bottom.rs +++ b/benches/generated/absolute_layout_width_height_end_bottom.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - right: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + right: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() }, ..Default::default() }, @@ -25,7 +27,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_width_height_start_top.rs b/benches/generated/absolute_layout_width_height_start_top.rs index 5e2e511a7..b0716ed08 100644 --- a/benches/generated/absolute_layout_width_height_start_top.rs +++ b/benches/generated/absolute_layout_width_height_start_top.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() }, ..Default::default() }, @@ -25,7 +27,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_width_height_start_top_end_bottom.rs b/benches/generated/absolute_layout_width_height_start_top_end_bottom.rs index 96ba399d4..99e948759 100644 --- a/benches/generated/absolute_layout_width_height_start_top_end_bottom.rs +++ b/benches/generated/absolute_layout_width_height_start_top_end_bottom.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,14 +9,14 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() }, ..Default::default() }, @@ -27,7 +29,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/absolute_layout_within_border.rs b/benches/generated/absolute_layout_within_border.rs index 2a3a628ea..ff72a32c4 100644 --- a/benches/generated/absolute_layout_within_border.rs +++ b/benches/generated/absolute_layout_within_border.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(0f32), - top: taffy::style::Dimension::Points(0f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(0f32), + top: taffy::style::LengthPercentageAuto::Points(0f32), + ..Rect::auto() }, ..Default::default() }, @@ -26,12 +28,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - right: taffy::style::Dimension::Points(0f32), - bottom: taffy::style::Dimension::Points(0f32), - ..Default::default() + right: taffy::style::LengthPercentageAuto::Points(0f32), + bottom: taffy::style::LengthPercentageAuto::Points(0f32), + ..Rect::auto() }, ..Default::default() }, @@ -45,19 +47,19 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(0f32), - top: taffy::style::Dimension::Points(0f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(0f32), + top: taffy::style::LengthPercentageAuto::Points(0f32), + ..Rect::auto() }, ..Default::default() }, @@ -71,19 +73,19 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, position: taffy::geometry::Rect { - right: taffy::style::Dimension::Points(0f32), - bottom: taffy::style::Dimension::Points(0f32), - ..Default::default() + right: taffy::style::LengthPercentageAuto::Points(0f32), + bottom: taffy::style::LengthPercentageAuto::Points(0f32), + ..Rect::auto() }, ..Default::default() }, @@ -96,21 +98,21 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, border: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, diff --git a/benches/generated/align_baseline.rs b/benches/generated/align_baseline.rs index 3577a55b9..845e65740 100644 --- a/benches/generated/align_baseline.rs +++ b/benches/generated/align_baseline.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_baseline_child_multiline.rs b/benches/generated/align_baseline_child_multiline.rs index 57da10452..f4d42e66c 100644 --- a/benches/generated/align_baseline_child_multiline.rs +++ b/benches/generated/align_baseline_child_multiline.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(60f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(25f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(25f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(25f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(25f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -69,7 +71,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[node10, node11, node12, node13], @@ -79,7 +81,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { align_items: taffy::style::AlignItems::Baseline, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/align_baseline_nested_child.rs b/benches/generated/align_baseline_nested_child.rs index b32cefed2..fb1bbc055 100644 --- a/benches/generated/align_baseline_nested_child.rs +++ b/benches/generated/align_baseline_nested_child.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -47,7 +49,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_center_should_size_based_on_content.rs b/benches/generated/align_center_should_size_based_on_content.rs index 76607a35d..4974830b4 100644 --- a/benches/generated/align_center_should_size_based_on_content.rs +++ b/benches/generated/align_center_should_size_based_on_content.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_content_space_around_single_line.rs b/benches/generated/align_content_space_around_single_line.rs index b5ff3dd00..a07a64d33 100644 --- a/benches/generated/align_content_space_around_single_line.rs +++ b/benches/generated/align_content_space_around_single_line.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,7 +73,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -85,7 +87,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_content_space_around_wrapped.rs b/benches/generated/align_content_space_around_wrapped.rs index fd151176f..8d27e756a 100644 --- a/benches/generated/align_content_space_around_wrapped.rs +++ b/benches/generated/align_content_space_around_wrapped.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,7 +73,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -86,7 +88,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_content_space_between_single_line.rs b/benches/generated/align_content_space_between_single_line.rs index d7740cff4..765d776c9 100644 --- a/benches/generated/align_content_space_between_single_line.rs +++ b/benches/generated/align_content_space_between_single_line.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,7 +73,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -85,7 +87,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_content_space_between_wrapped.rs b/benches/generated/align_content_space_between_wrapped.rs index eb93e40e2..b036aa563 100644 --- a/benches/generated/align_content_space_between_wrapped.rs +++ b/benches/generated/align_content_space_between_wrapped.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,7 +73,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -86,7 +88,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_content_space_evenly_single_line.rs b/benches/generated/align_content_space_evenly_single_line.rs index 360ba2403..db0c13d66 100644 --- a/benches/generated/align_content_space_evenly_single_line.rs +++ b/benches/generated/align_content_space_evenly_single_line.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,7 +73,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -85,7 +87,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_content_space_evenly_wrapped.rs b/benches/generated/align_content_space_evenly_wrapped.rs index 68fadb2ac..7a48300eb 100644 --- a/benches/generated/align_content_space_evenly_wrapped.rs +++ b/benches/generated/align_content_space_evenly_wrapped.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,7 +73,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -86,7 +88,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_flex_start_with_shrinking_children.rs b/benches/generated/align_flex_start_with_shrinking_children.rs index d7f062376..c6778d88b 100644 --- a/benches/generated/align_flex_start_with_shrinking_children.rs +++ b/benches/generated/align_flex_start_with_shrinking_children.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children(taffy::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() }, &[]) @@ -18,7 +20,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_flex_start_with_shrinking_children_with_stretch.rs b/benches/generated/align_flex_start_with_shrinking_children_with_stretch.rs index d7f062376..c6778d88b 100644 --- a/benches/generated/align_flex_start_with_shrinking_children_with_stretch.rs +++ b/benches/generated/align_flex_start_with_shrinking_children_with_stretch.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children(taffy::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() }, &[]) @@ -18,7 +20,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_flex_start_with_stretching_children.rs b/benches/generated/align_flex_start_with_stretching_children.rs index 59a7feb16..c41468475 100644 --- a/benches/generated/align_flex_start_with_stretching_children.rs +++ b/benches/generated/align_flex_start_with_stretching_children.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children(taffy::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() }, &[]) @@ -13,7 +15,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_items_center.rs b/benches/generated/align_items_center.rs index f0bc75fff..f2688d958 100644 --- a/benches/generated/align_items_center.rs +++ b/benches/generated/align_items_center.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_items_center_child_with_margin_bigger_than_parent.rs b/benches/generated/align_items_center_child_with_margin_bigger_than_parent.rs index c6c4b97c4..3d171d12e 100644 --- a/benches/generated/align_items_center_child_with_margin_bigger_than_parent.rs +++ b/benches/generated/align_items_center_child_with_margin_bigger_than_parent.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,12 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_items_center_child_without_margin_bigger_than_parent.rs b/benches/generated/align_items_center_child_without_margin_bigger_than_parent.rs index 7d6170808..9831a591c 100644 --- a/benches/generated/align_items_center_child_without_margin_bigger_than_parent.rs +++ b/benches/generated/align_items_center_child_without_margin_bigger_than_parent.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(70f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -27,7 +29,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_items_center_with_child_margin.rs b/benches/generated/align_items_center_with_child_margin.rs index bc263cbda..e4f066671 100644 --- a/benches/generated/align_items_center_with_child_margin.rs +++ b/benches/generated/align_items_center_with_child_margin.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,9 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() + }, + margin: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Points(10f32), ..Default::default() }, ..Default::default() }, &[], @@ -21,7 +26,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_items_center_with_child_top.rs b/benches/generated/align_items_center_with_child_top.rs index d60dbc3dd..29d4affc5 100644 --- a/benches/generated/align_items_center_with_child_top.rs +++ b/benches/generated/align_items_center_with_child_top.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,9 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() + }, + position: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() }, - position: taffy::geometry::Rect { top: taffy::style::Dimension::Points(10f32), ..Default::default() }, ..Default::default() }, &[], @@ -21,7 +26,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_items_flex_end.rs b/benches/generated/align_items_flex_end.rs index 5d4458d7d..bbbc822d9 100644 --- a/benches/generated/align_items_flex_end.rs +++ b/benches/generated/align_items_flex_end.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_items_flex_end_child_with_margin_bigger_than_parent.rs b/benches/generated/align_items_flex_end_child_with_margin_bigger_than_parent.rs index 892c1af6e..16681f367 100644 --- a/benches/generated/align_items_flex_end_child_with_margin_bigger_than_parent.rs +++ b/benches/generated/align_items_flex_end_child_with_margin_bigger_than_parent.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,12 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_items_flex_end_child_without_margin_bigger_than_parent.rs b/benches/generated/align_items_flex_end_child_without_margin_bigger_than_parent.rs index 400183c4e..0933a3175 100644 --- a/benches/generated/align_items_flex_end_child_without_margin_bigger_than_parent.rs +++ b/benches/generated/align_items_flex_end_child_without_margin_bigger_than_parent.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(70f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -27,7 +29,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_items_flex_start.rs b/benches/generated/align_items_flex_start.rs index 688bc6b66..5a9f4b2d0 100644 --- a/benches/generated/align_items_flex_start.rs +++ b/benches/generated/align_items_flex_start.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_items_min_max.rs b/benches/generated/align_items_min_max.rs index 60fd14ddd..4724afb61 100644 --- a/benches/generated/align_items_min_max.rs +++ b/benches/generated/align_items_min_max.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(60f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -18,15 +20,9 @@ pub fn compute() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, align_items: taffy::style::AlignItems::Center, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(200f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/align_items_stretch.rs b/benches/generated/align_items_stretch.rs index 5b06b8504..45a26a677 100644 --- a/benches/generated/align_items_stretch.rs +++ b/benches/generated/align_items_stretch.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -15,7 +17,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_self_baseline.rs b/benches/generated/align_self_baseline.rs index e176ad9f2..71b46a913 100644 --- a/benches/generated/align_self_baseline.rs +++ b/benches/generated/align_self_baseline.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -47,7 +49,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_self_center.rs b/benches/generated/align_self_center.rs index 2818e9b79..77ed1e9e4 100644 --- a/benches/generated/align_self_center.rs +++ b/benches/generated/align_self_center.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_self_flex_end.rs b/benches/generated/align_self_flex_end.rs index 66bce9579..99dd5efc1 100644 --- a/benches/generated/align_self_flex_end.rs +++ b/benches/generated/align_self_flex_end.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_self_flex_end_override_flex_start.rs b/benches/generated/align_self_flex_end_override_flex_start.rs index 6904a1d54..f2dbce164 100644 --- a/benches/generated/align_self_flex_end_override_flex_start.rs +++ b/benches/generated/align_self_flex_end_override_flex_start.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_self_flex_start.rs b/benches/generated/align_self_flex_start.rs index 8376f29cb..781de261a 100644 --- a/benches/generated/align_self_flex_start.rs +++ b/benches/generated/align_self_flex_start.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/align_strech_should_size_based_on_parent.rs b/benches/generated/align_strech_should_size_based_on_parent.rs index ca667357c..6f3df07d6 100644 --- a/benches/generated/align_strech_should_size_based_on_parent.rs +++ b/benches/generated/align_strech_should_size_based_on_parent.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/border_center_child.rs b/benches/generated/border_center_child.rs index 7afa149d6..10388128f 100644 --- a/benches/generated/border_center_child.rs +++ b/benches/generated/border_center_child.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,12 +23,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, border: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(20f32), - ..Default::default() + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(20f32), + ..Rect::zero() }, ..Default::default() }, diff --git a/benches/generated/border_flex_child.rs b/benches/generated/border_flex_child.rs index a2b4d0dd2..7c4680eee 100644 --- a/benches/generated/border_flex_child.rs +++ b/benches/generated/border_flex_child.rs @@ -1,10 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,14 +18,14 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, border: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, diff --git a/benches/generated/border_no_child.rs b/benches/generated/border_no_child.rs index 27e7fad2c..7ab4e70c8 100644 --- a/benches/generated/border_no_child.rs +++ b/benches/generated/border_no_child.rs @@ -1,14 +1,16 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node = taffy .new_with_children( taffy::style::Style { border: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, diff --git a/benches/generated/border_stretch_child.rs b/benches/generated/border_stretch_child.rs index b607d1ab9..e4811cc17 100644 --- a/benches/generated/border_stretch_child.rs +++ b/benches/generated/border_stretch_child.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -15,14 +17,14 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, border: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, diff --git a/benches/generated/child_min_max_width_flexing.rs b/benches/generated/child_min_max_width_flexing.rs index 23231b4fa..f3fa1dde4 100644 --- a/benches/generated/child_min_max_width_flexing.rs +++ b/benches/generated/child_min_max_width_flexing.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { flex_grow: 1f32, flex_shrink: 0f32, flex_basis: taffy::style::Dimension::Points(0f32), - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -18,7 +20,7 @@ pub fn compute() { flex_grow: 1f32, flex_shrink: 0f32, flex_basis: taffy::style::Dimension::Percent(0.5f32), - max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -30,7 +32,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(120f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/container_with_unsized_child.rs b/benches/generated/container_with_unsized_child.rs index b15cd2568..58961fd3f 100644 --- a/benches/generated/container_with_unsized_child.rs +++ b/benches/generated/container_with_unsized_child.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[]).unwrap(); let node = taffy @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/display_none.rs b/benches/generated/display_none.rs index d8595c205..c7f901009 100644 --- a/benches/generated/display_none.rs +++ b/benches/generated/display_none.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy @@ -13,7 +15,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/display_none_fixed_size.rs b/benches/generated/display_none_fixed_size.rs index b87a4b87d..c224eeb06 100644 --- a/benches/generated/display_none_fixed_size.rs +++ b/benches/generated/display_none_fixed_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy @@ -8,7 +10,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/display_none_with_child.rs b/benches/generated/display_none_with_child.rs index 05bf31ee0..910530d32 100644 --- a/benches/generated/display_none_with_child.rs +++ b/benches/generated/display_none_with_child.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -17,7 +19,7 @@ pub fn compute() { flex_grow: 1f32, flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -53,7 +55,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/display_none_with_margin.rs b/benches/generated/display_none_with_margin.rs index e049c66d9..394f611b2 100644 --- a/benches/generated/display_none_with_margin.rs +++ b/benches/generated/display_none_with_margin.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,14 +9,14 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -28,7 +30,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/display_none_with_position.rs b/benches/generated/display_none_with_position.rs index 65f3c090e..2621891d4 100644 --- a/benches/generated/display_none_with_position.rs +++ b/benches/generated/display_none_with_position.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy @@ -6,7 +8,10 @@ pub fn compute() { taffy::style::Style { display: taffy::style::Display::None, flex_grow: 1f32, - position: taffy::geometry::Rect { top: taffy::style::Dimension::Points(10f32), ..Default::default() }, + position: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() + }, ..Default::default() }, &[], @@ -18,7 +23,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_basis_and_main_dimen_set_when_flexing.rs b/benches/generated/flex_basis_and_main_dimen_set_when_flexing.rs index d280ef47c..475456be4 100644 --- a/benches/generated/flex_basis_and_main_dimen_set_when_flexing.rs +++ b/benches/generated/flex_basis_and_main_dimen_set_when_flexing.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -23,7 +25,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/flex_basis_flex_grow_column.rs b/benches/generated/flex_basis_flex_grow_column.rs index 250555137..f8e1a1510 100644 --- a/benches/generated/flex_basis_flex_grow_column.rs +++ b/benches/generated/flex_basis_flex_grow_column.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -18,7 +20,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_basis_flex_grow_row.rs b/benches/generated/flex_basis_flex_grow_row.rs index ecd292e4f..ebc426faa 100644 --- a/benches/generated/flex_basis_flex_grow_row.rs +++ b/benches/generated/flex_basis_flex_grow_row.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -17,7 +19,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_basis_flex_shrink_column.rs b/benches/generated/flex_basis_flex_shrink_column.rs index 9b0619558..ad0bf67ca 100644 --- a/benches/generated/flex_basis_flex_shrink_column.rs +++ b/benches/generated/flex_basis_flex_shrink_column.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_basis_flex_shrink_row.rs b/benches/generated/flex_basis_flex_shrink_row.rs index bdc1bb790..0054681be 100644 --- a/benches/generated/flex_basis_flex_shrink_row.rs +++ b/benches/generated/flex_basis_flex_shrink_row.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -18,7 +20,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_basis_larger_than_content_column.rs b/benches/generated/flex_basis_larger_than_content_column.rs index 536c37f0f..60dbcc38d 100644 --- a/benches/generated/flex_basis_larger_than_content_column.rs +++ b/benches/generated/flex_basis_larger_than_content_column.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -27,7 +29,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/flex_basis_larger_than_content_row.rs b/benches/generated/flex_basis_larger_than_content_row.rs index bb29fc572..53fc13d86 100644 --- a/benches/generated/flex_basis_larger_than_content_row.rs +++ b/benches/generated/flex_basis_larger_than_content_row.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -26,7 +28,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/flex_basis_overrides_main_size.rs b/benches/generated/flex_basis_overrides_main_size.rs index e265d816b..4b63488b8 100644 --- a/benches/generated/flex_basis_overrides_main_size.rs +++ b/benches/generated/flex_basis_overrides_main_size.rs @@ -1,11 +1,13 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -15,7 +17,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -25,7 +27,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -37,7 +39,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_basis_slightly_smaller_then_content_with_flex_grow_large_size.rs b/benches/generated/flex_basis_slightly_smaller_then_content_with_flex_grow_large_size.rs index e0f52889d..fc74e331e 100644 --- a/benches/generated/flex_basis_slightly_smaller_then_content_with_flex_grow_large_size.rs +++ b/benches/generated/flex_basis_slightly_smaller_then_content_with_flex_grow_large_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,7 +32,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -51,7 +53,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/flex_basis_smaller_than_content_column.rs b/benches/generated/flex_basis_smaller_than_content_column.rs index 1f71eb36c..877effff7 100644 --- a/benches/generated/flex_basis_smaller_than_content_column.rs +++ b/benches/generated/flex_basis_smaller_than_content_column.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -27,7 +29,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/flex_basis_smaller_than_content_row.rs b/benches/generated/flex_basis_smaller_than_content_row.rs index dcf9cecba..acbe83da6 100644 --- a/benches/generated/flex_basis_smaller_than_content_row.rs +++ b/benches/generated/flex_basis_smaller_than_content_row.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -26,7 +28,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/flex_basis_smaller_than_main_dimen_column.rs b/benches/generated/flex_basis_smaller_than_main_dimen_column.rs index 9212dd0af..69dd2246c 100644 --- a/benches/generated/flex_basis_smaller_than_main_dimen_column.rs +++ b/benches/generated/flex_basis_smaller_than_main_dimen_column.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -18,7 +20,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/flex_basis_smaller_than_main_dimen_row.rs b/benches/generated/flex_basis_smaller_than_main_dimen_row.rs index 5234bc529..b98d01c35 100644 --- a/benches/generated/flex_basis_smaller_than_main_dimen_row.rs +++ b/benches/generated/flex_basis_smaller_than_main_dimen_row.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -17,7 +19,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/flex_basis_smaller_then_content_with_flex_grow_large_size.rs b/benches/generated/flex_basis_smaller_then_content_with_flex_grow_large_size.rs index 053fb4732..be29c6254 100644 --- a/benches/generated/flex_basis_smaller_then_content_with_flex_grow_large_size.rs +++ b/benches/generated/flex_basis_smaller_then_content_with_flex_grow_large_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,7 +32,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -51,7 +53,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/flex_basis_smaller_then_content_with_flex_grow_small_size.rs b/benches/generated/flex_basis_smaller_then_content_with_flex_grow_small_size.rs index 119fe56fe..02ab0b740 100644 --- a/benches/generated/flex_basis_smaller_then_content_with_flex_grow_small_size.rs +++ b/benches/generated/flex_basis_smaller_then_content_with_flex_grow_small_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,7 +32,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -51,7 +53,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/flex_basis_smaller_then_content_with_flex_grow_unconstraint_size.rs b/benches/generated/flex_basis_smaller_then_content_with_flex_grow_unconstraint_size.rs index 0e6184e4b..8824cf95b 100644 --- a/benches/generated/flex_basis_smaller_then_content_with_flex_grow_unconstraint_size.rs +++ b/benches/generated/flex_basis_smaller_then_content_with_flex_grow_unconstraint_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,7 +32,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_basis_smaller_then_content_with_flex_grow_very_large_size.rs b/benches/generated/flex_basis_smaller_then_content_with_flex_grow_very_large_size.rs index 3b28ca909..1a7747fce 100644 --- a/benches/generated/flex_basis_smaller_then_content_with_flex_grow_very_large_size.rs +++ b/benches/generated/flex_basis_smaller_then_content_with_flex_grow_very_large_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,7 +32,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -51,7 +53,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/flex_basis_unconstraint_column.rs b/benches/generated/flex_basis_unconstraint_column.rs index 216a3ba10..41fc0c7cc 100644 --- a/benches/generated/flex_basis_unconstraint_column.rs +++ b/benches/generated/flex_basis_unconstraint_column.rs @@ -1,10 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], diff --git a/benches/generated/flex_basis_unconstraint_row.rs b/benches/generated/flex_basis_unconstraint_row.rs index b6d31b93c..f3f2ffa1b 100644 --- a/benches/generated/flex_basis_unconstraint_row.rs +++ b/benches/generated/flex_basis_unconstraint_row.rs @@ -1,10 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], diff --git a/benches/generated/flex_direction_column.rs b/benches/generated/flex_direction_column.rs index 25659dcdf..115e63c0d 100644 --- a/benches/generated/flex_direction_column.rs +++ b/benches/generated/flex_direction_column.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_direction_column_no_height.rs b/benches/generated/flex_direction_column_no_height.rs index 65f538a4e..c75739194 100644 --- a/benches/generated/flex_direction_column_no_height.rs +++ b/benches/generated/flex_direction_column_no_height.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -31,7 +33,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2], diff --git a/benches/generated/flex_direction_column_reverse.rs b/benches/generated/flex_direction_column_reverse.rs index 20d76cc7e..3b626ad15 100644 --- a/benches/generated/flex_direction_column_reverse.rs +++ b/benches/generated/flex_direction_column_reverse.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_direction_row.rs b/benches/generated/flex_direction_row.rs index 28769c015..3c41844d6 100644 --- a/benches/generated/flex_direction_row.rs +++ b/benches/generated/flex_direction_row.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -33,7 +35,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_direction_row_no_width.rs b/benches/generated/flex_direction_row_no_width.rs index 8fb65d3c9..9411ad6f0 100644 --- a/benches/generated/flex_direction_row_no_width.rs +++ b/benches/generated/flex_direction_row_no_width.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -30,7 +32,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2], diff --git a/benches/generated/flex_direction_row_reverse.rs b/benches/generated/flex_direction_row_reverse.rs index de8e29dad..da474e792 100644 --- a/benches/generated/flex_direction_row_reverse.rs +++ b/benches/generated/flex_direction_row_reverse.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_grow_child.rs b/benches/generated/flex_grow_child.rs index 43902309d..11488ebd9 100644 --- a/benches/generated/flex_grow_child.rs +++ b/benches/generated/flex_grow_child.rs @@ -1,11 +1,13 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(0f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], diff --git a/benches/generated/flex_grow_flex_basis_percent_min_max.rs b/benches/generated/flex_grow_flex_basis_percent_min_max.rs index 332118de0..86c5ae916 100644 --- a/benches/generated/flex_grow_flex_basis_percent_min_max.rs +++ b/benches/generated/flex_grow_flex_basis_percent_min_max.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,8 +8,8 @@ pub fn compute() { flex_grow: 1f32, flex_shrink: 0f32, flex_basis: taffy::style::Dimension::Points(0f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,9 +24,9 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, - max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -33,7 +35,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(120f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(120f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/flex_grow_height_maximized.rs b/benches/generated/flex_grow_height_maximized.rs index e30025b6a..9401edd4a 100644 --- a/benches/generated/flex_grow_height_maximized.rs +++ b/benches/generated/flex_grow_height_maximized.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -13,7 +15,7 @@ pub fn compute() { let node01 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -24,14 +26,8 @@ pub fn compute() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(500f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(500f32), ..Size::auto() }, ..Default::default() }, &[node00, node01], @@ -44,7 +40,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_grow_in_at_most_container.rs b/benches/generated/flex_grow_in_at_most_container.rs index 630ce7af7..34b9d2d2f 100644 --- a/benches/generated/flex_grow_in_at_most_container.rs +++ b/benches/generated/flex_grow_in_at_most_container.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -18,7 +20,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_grow_less_than_factor_one.rs b/benches/generated/flex_grow_less_than_factor_one.rs index 284b25eea..c9e88d66a 100644 --- a/benches/generated/flex_grow_less_than_factor_one.rs +++ b/benches/generated/flex_grow_less_than_factor_one.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -23,7 +25,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_grow_root_minimized.rs b/benches/generated/flex_grow_root_minimized.rs index ce6a2f95c..c6e343858 100644 --- a/benches/generated/flex_grow_root_minimized.rs +++ b/benches/generated/flex_grow_root_minimized.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -13,7 +15,7 @@ pub fn compute() { let node01 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -24,14 +26,8 @@ pub fn compute() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(500f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(500f32), ..Size::auto() }, ..Default::default() }, &[node00, node01], @@ -41,15 +37,9 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(500f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(500f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/flex_grow_shrink_at_most.rs b/benches/generated/flex_grow_shrink_at_most.rs index 115720e8b..a4f73236c 100644 --- a/benches/generated/flex_grow_shrink_at_most.rs +++ b/benches/generated/flex_grow_shrink_at_most.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children(taffy::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() }, &[]) @@ -10,7 +12,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_grow_to_min.rs b/benches/generated/flex_grow_to_min.rs index 805945b8a..7ba2d5ca2 100644 --- a/benches/generated/flex_grow_to_min.rs +++ b/benches/generated/flex_grow_to_min.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children(taffy::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() }, &[]) @@ -6,7 +8,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,15 +18,9 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(500f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(500f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/flex_grow_within_constrained_max_column.rs b/benches/generated/flex_grow_within_constrained_max_column.rs index 4279360db..2e23e9bf6 100644 --- a/benches/generated/flex_grow_within_constrained_max_column.rs +++ b/benches/generated/flex_grow_within_constrained_max_column.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -13,7 +15,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -23,11 +25,8 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/flex_grow_within_constrained_max_row.rs b/benches/generated/flex_grow_within_constrained_max_row.rs index 22c62ebe7..f23bcc39b 100644 --- a/benches/generated/flex_grow_within_constrained_max_row.rs +++ b/benches/generated/flex_grow_within_constrained_max_row.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -13,7 +15,7 @@ pub fn compute() { let node01 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,11 +24,8 @@ pub fn compute() { let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node00, node01], @@ -36,7 +35,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/flex_grow_within_constrained_max_width.rs b/benches/generated/flex_grow_within_constrained_max_width.rs index 8bffddc5c..a334d5984 100644 --- a/benches/generated/flex_grow_within_constrained_max_width.rs +++ b/benches/generated/flex_grow_within_constrained_max_width.rs @@ -1,10 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,10 +15,7 @@ pub fn compute() { let node0 = taffy .new_with_children( taffy::style::Style { - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(300f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(300f32), ..Size::auto() }, ..Default::default() }, &[node00], @@ -29,7 +28,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_grow_within_constrained_min_column.rs b/benches/generated/flex_grow_within_constrained_min_column.rs index 6654f1baa..2dff2e324 100644 --- a/benches/generated/flex_grow_within_constrained_min_column.rs +++ b/benches/generated/flex_grow_within_constrained_min_column.rs @@ -1,10 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -14,10 +16,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/flex_grow_within_constrained_min_max_column.rs b/benches/generated/flex_grow_within_constrained_min_max_column.rs index 98b835fd8..7dd1054d3 100644 --- a/benches/generated/flex_grow_within_constrained_min_max_column.rs +++ b/benches/generated/flex_grow_within_constrained_min_max_column.rs @@ -1,10 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,10 +15,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/flex_grow_within_constrained_min_row.rs b/benches/generated/flex_grow_within_constrained_min_row.rs index a73fe6986..1b50b663f 100644 --- a/benches/generated/flex_grow_within_constrained_min_row.rs +++ b/benches/generated/flex_grow_within_constrained_min_row.rs @@ -1,10 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,11 +15,8 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/flex_grow_within_max_width.rs b/benches/generated/flex_grow_within_max_width.rs index 4aa55752a..59399d195 100644 --- a/benches/generated/flex_grow_within_max_width.rs +++ b/benches/generated/flex_grow_within_max_width.rs @@ -1,10 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,10 +15,7 @@ pub fn compute() { let node0 = taffy .new_with_children( taffy::style::Style { - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node00], @@ -29,7 +28,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_root_ignored.rs b/benches/generated/flex_root_ignored.rs index d9cac4cde..aadf1ca75 100644 --- a/benches/generated/flex_root_ignored.rs +++ b/benches/generated/flex_root_ignored.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -13,7 +15,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -23,15 +25,9 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(500f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(500f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/flex_shrink_by_outer_margin_with_max_size.rs b/benches/generated/flex_shrink_by_outer_margin_with_max_size.rs index 5bf986d4a..df405b196 100644 --- a/benches/generated/flex_shrink_by_outer_margin_with_max_size.rs +++ b/benches/generated/flex_shrink_by_outer_margin_with_max_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,9 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() + }, + margin: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(100f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Points(100f32), ..Default::default() }, ..Default::default() }, &[], @@ -18,11 +23,8 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(80f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(80f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/flex_shrink_flex_grow_child_flex_shrink_other_child.rs b/benches/generated/flex_shrink_flex_grow_child_flex_shrink_other_child.rs index bcad0f489..ed95a8a64 100644 --- a/benches/generated/flex_shrink_flex_grow_child_flex_shrink_other_child.rs +++ b/benches/generated/flex_shrink_flex_grow_child_flex_shrink_other_child.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -23,7 +25,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -36,7 +38,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_shrink_flex_grow_row.rs b/benches/generated/flex_shrink_flex_grow_row.rs index 02f5f4f71..d99350bbe 100644 --- a/benches/generated/flex_shrink_flex_grow_row.rs +++ b/benches/generated/flex_shrink_flex_grow_row.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -23,7 +25,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -36,7 +38,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_shrink_to_zero.rs b/benches/generated/flex_shrink_to_zero.rs index 50ae9c3d1..2c8dd88ff 100644 --- a/benches/generated/flex_shrink_to_zero.rs +++ b/benches/generated/flex_shrink_to_zero.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -35,7 +37,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(75f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(75f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2], diff --git a/benches/generated/flex_wrap_align_stretch_fits_one_row.rs b/benches/generated/flex_wrap_align_stretch_fits_one_row.rs index d58880c41..c193be688 100644 --- a/benches/generated/flex_wrap_align_stretch_fits_one_row.rs +++ b/benches/generated/flex_wrap_align_stretch_fits_one_row.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -25,7 +27,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(150f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/flex_wrap_children_with_min_main_overriding_flex_basis.rs b/benches/generated/flex_wrap_children_with_min_main_overriding_flex_basis.rs index 262d719a9..f8e340e8a 100644 --- a/benches/generated/flex_wrap_children_with_min_main_overriding_flex_basis.rs +++ b/benches/generated/flex_wrap_children_with_min_main_overriding_flex_basis.rs @@ -1,11 +1,13 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(55f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(55f32), ..Size::auto() }, ..Default::default() }, &[], @@ -15,8 +17,8 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(55f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(55f32), ..Size::auto() }, ..Default::default() }, &[], @@ -26,7 +28,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/flex_wrap_wrap_to_child_height.rs b/benches/generated/flex_wrap_wrap_to_child_height.rs index ab91e5469..5787b97a3 100644 --- a/benches/generated/flex_wrap_wrap_to_child_height.rs +++ b/benches/generated/flex_wrap_wrap_to_child_height.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -17,7 +19,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node000], @@ -39,7 +41,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_child_margins.rs b/benches/generated/gap_column_gap_child_margins.rs index ac32a9663..04cad1d12 100644 --- a/benches/generated/gap_column_gap_child_margins.rs +++ b/benches/generated/gap_column_gap_child_margins.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,9 @@ pub fn compute() { flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(2f32), - right: taffy::style::Dimension::Points(2f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(2f32), + right: taffy::style::LengthPercentageAuto::Points(2f32), + ..Rect::zero() }, ..Default::default() }, @@ -23,9 +25,9 @@ pub fn compute() { flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -39,9 +41,9 @@ pub fn compute() { flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(15f32), - right: taffy::style::Dimension::Points(15f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(15f32), + right: taffy::style::LengthPercentageAuto::Points(15f32), + ..Rect::zero() }, ..Default::default() }, @@ -51,11 +53,11 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_flexible.rs b/benches/generated/gap_column_gap_flexible.rs index eb90596e3..01b186144 100644 --- a/benches/generated/gap_column_gap_flexible.rs +++ b/benches/generated/gap_column_gap_flexible.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -37,14 +39,14 @@ pub fn compute() { .new_with_children( taffy::style::Style { gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_flexible_undefined_parent.rs b/benches/generated/gap_column_gap_flexible_undefined_parent.rs index c676b3ecb..0cee6a76b 100644 --- a/benches/generated/gap_column_gap_flexible_undefined_parent.rs +++ b/benches/generated/gap_column_gap_flexible_undefined_parent.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -37,11 +39,11 @@ pub fn compute() { .new_with_children( taffy::style::Style { gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2], diff --git a/benches/generated/gap_column_gap_inflexible.rs b/benches/generated/gap_column_gap_inflexible.rs index 0cf34b09a..178dfc34a 100644 --- a/benches/generated/gap_column_gap_inflexible.rs +++ b/benches/generated/gap_column_gap_inflexible.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -30,11 +32,11 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_inflexible_undefined_parent.rs b/benches/generated/gap_column_gap_inflexible_undefined_parent.rs index 004264c33..818e8d01c 100644 --- a/benches/generated/gap_column_gap_inflexible_undefined_parent.rs +++ b/benches/generated/gap_column_gap_inflexible_undefined_parent.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -30,8 +32,8 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2], diff --git a/benches/generated/gap_column_gap_justify_center.rs b/benches/generated/gap_column_gap_justify_center.rs index 12361d48c..0539c3d17 100644 --- a/benches/generated/gap_column_gap_justify_center.rs +++ b/benches/generated/gap_column_gap_justify_center.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -31,11 +33,11 @@ pub fn compute() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::Center, - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_justify_flex_end.rs b/benches/generated/gap_column_gap_justify_flex_end.rs index ed12c8bc5..7771d4545 100644 --- a/benches/generated/gap_column_gap_justify_flex_end.rs +++ b/benches/generated/gap_column_gap_justify_flex_end.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -31,11 +33,11 @@ pub fn compute() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::FlexEnd, - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_justify_flex_start.rs b/benches/generated/gap_column_gap_justify_flex_start.rs index a8eb57a8f..96bfa87cc 100644 --- a/benches/generated/gap_column_gap_justify_flex_start.rs +++ b/benches/generated/gap_column_gap_justify_flex_start.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -30,11 +32,11 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_justify_space_around.rs b/benches/generated/gap_column_gap_justify_space_around.rs index 14e501d61..e9187b73a 100644 --- a/benches/generated/gap_column_gap_justify_space_around.rs +++ b/benches/generated/gap_column_gap_justify_space_around.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -31,11 +33,11 @@ pub fn compute() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::SpaceAround, - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_justify_space_between.rs b/benches/generated/gap_column_gap_justify_space_between.rs index 7be980213..bfc398ee0 100644 --- a/benches/generated/gap_column_gap_justify_space_between.rs +++ b/benches/generated/gap_column_gap_justify_space_between.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -31,11 +33,11 @@ pub fn compute() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::SpaceBetween, - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_justify_space_evenly.rs b/benches/generated/gap_column_gap_justify_space_evenly.rs index 55ad0faaa..44307938a 100644 --- a/benches/generated/gap_column_gap_justify_space_evenly.rs +++ b/benches/generated/gap_column_gap_justify_space_evenly.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -31,11 +33,11 @@ pub fn compute() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::SpaceEvenly, - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_mixed_flexible.rs b/benches/generated/gap_column_gap_mixed_flexible.rs index a5e72d909..432b1008e 100644 --- a/benches/generated/gap_column_gap_mixed_flexible.rs +++ b/benches/generated/gap_column_gap_mixed_flexible.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -23,7 +25,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -32,11 +34,11 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_percentage_cyclic_partially_shrinkable.rs b/benches/generated/gap_column_gap_percentage_cyclic_partially_shrinkable.rs index 36e79c1b8..bd04e7b98 100644 --- a/benches/generated/gap_column_gap_percentage_cyclic_partially_shrinkable.rs +++ b/benches/generated/gap_column_gap_percentage_cyclic_partially_shrinkable.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -44,7 +46,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.5f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Percent(0.5f32), ..Size::zero() }, ..Default::default() }, &[node0, node1, node2], diff --git a/benches/generated/gap_column_gap_percentage_cyclic_shrinkable.rs b/benches/generated/gap_column_gap_percentage_cyclic_shrinkable.rs index ce3ad0a38..9902ef769 100644 --- a/benches/generated/gap_column_gap_percentage_cyclic_shrinkable.rs +++ b/benches/generated/gap_column_gap_percentage_cyclic_shrinkable.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -42,7 +44,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Percent(0.2f32), ..Size::zero() }, ..Default::default() }, &[node0, node1, node2], diff --git a/benches/generated/gap_column_gap_percentage_cyclic_unshrinkable.rs b/benches/generated/gap_column_gap_percentage_cyclic_unshrinkable.rs index c3992cc0d..f6351c91e 100644 --- a/benches/generated/gap_column_gap_percentage_cyclic_unshrinkable.rs +++ b/benches/generated/gap_column_gap_percentage_cyclic_unshrinkable.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -35,7 +37,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Percent(0.2f32), ..Size::zero() }, ..Default::default() }, &[node0, node1, node2], diff --git a/benches/generated/gap_column_gap_percentage_flexible.rs b/benches/generated/gap_column_gap_percentage_flexible.rs index 3e34fdb93..23af8ac22 100644 --- a/benches/generated/gap_column_gap_percentage_flexible.rs +++ b/benches/generated/gap_column_gap_percentage_flexible.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -37,14 +39,14 @@ pub fn compute() { .new_with_children( taffy::style::Style { gap: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.1f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Percent(0.1f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_percentage_inflexible.rs b/benches/generated/gap_column_gap_percentage_inflexible.rs index 57c4dc63c..60a7e3d69 100644 --- a/benches/generated/gap_column_gap_percentage_inflexible.rs +++ b/benches/generated/gap_column_gap_percentage_inflexible.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -30,11 +32,11 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Percent(0.2f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_wrap_align_center.rs b/benches/generated/gap_column_gap_wrap_align_center.rs index ab21fafd6..dc2a53c2a 100644 --- a/benches/generated/gap_column_gap_wrap_align_center.rs +++ b/benches/generated/gap_column_gap_wrap_align_center.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,7 +73,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -84,14 +86,14 @@ pub fn compute() { flex_wrap: taffy::style::FlexWrap::Wrap, align_content: taffy::style::AlignContent::Center, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_wrap_align_flex_end.rs b/benches/generated/gap_column_gap_wrap_align_flex_end.rs index 480c0a2da..3fc6b091d 100644 --- a/benches/generated/gap_column_gap_wrap_align_flex_end.rs +++ b/benches/generated/gap_column_gap_wrap_align_flex_end.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,7 +73,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -84,14 +86,14 @@ pub fn compute() { flex_wrap: taffy::style::FlexWrap::Wrap, align_content: taffy::style::AlignContent::FlexEnd, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_wrap_align_flex_start.rs b/benches/generated/gap_column_gap_wrap_align_flex_start.rs index 2fbfd4bc0..0332525b4 100644 --- a/benches/generated/gap_column_gap_wrap_align_flex_start.rs +++ b/benches/generated/gap_column_gap_wrap_align_flex_start.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,7 +73,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -84,14 +86,14 @@ pub fn compute() { flex_wrap: taffy::style::FlexWrap::Wrap, align_content: taffy::style::AlignContent::FlexStart, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_wrap_align_space_around.rs b/benches/generated/gap_column_gap_wrap_align_space_around.rs index 6ad4a8d5e..3e357b555 100644 --- a/benches/generated/gap_column_gap_wrap_align_space_around.rs +++ b/benches/generated/gap_column_gap_wrap_align_space_around.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,7 +73,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -84,14 +86,14 @@ pub fn compute() { flex_wrap: taffy::style::FlexWrap::Wrap, align_content: taffy::style::AlignContent::SpaceAround, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_wrap_align_space_between.rs b/benches/generated/gap_column_gap_wrap_align_space_between.rs index 7b40ef693..79f809b89 100644 --- a/benches/generated/gap_column_gap_wrap_align_space_between.rs +++ b/benches/generated/gap_column_gap_wrap_align_space_between.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,7 +73,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -84,14 +86,14 @@ pub fn compute() { flex_wrap: taffy::style::FlexWrap::Wrap, align_content: taffy::style::AlignContent::SpaceBetween, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_gap_wrap_align_stretch.rs b/benches/generated/gap_column_gap_wrap_align_stretch.rs index b642ef23c..fb9740739 100644 --- a/benches/generated/gap_column_gap_wrap_align_stretch.rs +++ b/benches/generated/gap_column_gap_wrap_align_stretch.rs @@ -1,10 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -14,7 +16,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -24,7 +26,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +36,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -44,7 +46,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -54,11 +56,11 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(5f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(5f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(300f32), height: taffy::style::Dimension::Points(300f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_column_row_gap_wrapping.rs b/benches/generated/gap_column_row_gap_wrapping.rs index e294f36b3..13dee628a 100644 --- a/benches/generated/gap_column_row_gap_wrapping.rs +++ b/benches/generated/gap_column_row_gap_wrapping.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,7 +73,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -84,7 +86,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -97,7 +99,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -110,7 +112,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -122,11 +124,11 @@ pub fn compute() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3, node4, node5, node6, node7, node8], diff --git a/benches/generated/gap_percentage_row_gap_wrapping.rs b/benches/generated/gap_percentage_row_gap_wrapping.rs index df9827450..30d77ca54 100644 --- a/benches/generated/gap_percentage_row_gap_wrapping.rs +++ b/benches/generated/gap_percentage_row_gap_wrapping.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,7 +73,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -84,7 +86,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -97,7 +99,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -110,7 +112,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -122,11 +124,11 @@ pub fn compute() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Percent(0.1f32), + ..Size::zero() }, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3, node4, node5, node6, node7, node8], diff --git a/benches/generated/gap_row_gap_align_items_end.rs b/benches/generated/gap_row_gap_align_items_end.rs index 7d974558f..7587b9eb8 100644 --- a/benches/generated/gap_row_gap_align_items_end.rs +++ b/benches/generated/gap_row_gap_align_items_end.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -30,7 +32,7 @@ pub fn compute() { let node3 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -39,7 +41,7 @@ pub fn compute() { let node4 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -48,7 +50,7 @@ pub fn compute() { let node5 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -60,14 +62,14 @@ pub fn compute() { flex_wrap: taffy::style::FlexWrap::Wrap, align_items: taffy::style::AlignItems::FlexEnd, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_row_gap_align_items_stretch.rs b/benches/generated/gap_row_gap_align_items_stretch.rs index a2a0b2188..9916d4dec 100644 --- a/benches/generated/gap_row_gap_align_items_stretch.rs +++ b/benches/generated/gap_row_gap_align_items_stretch.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -30,7 +32,7 @@ pub fn compute() { let node3 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -39,7 +41,7 @@ pub fn compute() { let node4 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -48,7 +50,7 @@ pub fn compute() { let node5 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -59,14 +61,14 @@ pub fn compute() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_row_gap_column_child_margins.rs b/benches/generated/gap_row_gap_column_child_margins.rs index 851cc8834..ca89e0290 100644 --- a/benches/generated/gap_row_gap_column_child_margins.rs +++ b/benches/generated/gap_row_gap_column_child_margins.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,9 @@ pub fn compute() { flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(2f32), - bottom: taffy::style::Dimension::Points(2f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(2f32), + bottom: taffy::style::LengthPercentageAuto::Points(2f32), + ..Rect::zero() }, ..Default::default() }, @@ -23,9 +25,9 @@ pub fn compute() { flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -39,9 +41,9 @@ pub fn compute() { flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(15f32), - bottom: taffy::style::Dimension::Points(15f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(15f32), + bottom: taffy::style::LengthPercentageAuto::Points(15f32), + ..Rect::zero() }, ..Default::default() }, @@ -52,11 +54,11 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - gap: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { height: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/gap_row_gap_row_wrap_child_margins.rs b/benches/generated/gap_row_gap_row_wrap_child_margins.rs index 77088b24c..c2fd6ffc8 100644 --- a/benches/generated/gap_row_gap_row_wrap_child_margins.rs +++ b/benches/generated/gap_row_gap_row_wrap_child_margins.rs @@ -1,13 +1,15 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(2f32), - bottom: taffy::style::Dimension::Points(2f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(2f32), + bottom: taffy::style::LengthPercentageAuto::Points(2f32), + ..Rect::zero() }, ..Default::default() }, @@ -17,11 +19,11 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -31,11 +33,11 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(15f32), - bottom: taffy::style::Dimension::Points(15f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(15f32), + bottom: taffy::style::LengthPercentageAuto::Points(15f32), + ..Rect::zero() }, ..Default::default() }, @@ -46,11 +48,11 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, - gap: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { height: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/justify_content_column_center.rs b/benches/generated/justify_content_column_center.rs index d41d0a526..dd4d4a7a5 100644 --- a/benches/generated/justify_content_column_center.rs +++ b/benches/generated/justify_content_column_center.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/justify_content_column_flex_end.rs b/benches/generated/justify_content_column_flex_end.rs index fcea1b606..f7bf0b1f6 100644 --- a/benches/generated/justify_content_column_flex_end.rs +++ b/benches/generated/justify_content_column_flex_end.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/justify_content_column_flex_start.rs b/benches/generated/justify_content_column_flex_start.rs index 25659dcdf..115e63c0d 100644 --- a/benches/generated/justify_content_column_flex_start.rs +++ b/benches/generated/justify_content_column_flex_start.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/justify_content_column_min_height_and_margin_bottom.rs b/benches/generated/justify_content_column_min_height_and_margin_bottom.rs index 81457c016..b96f0f6ad 100644 --- a/benches/generated/justify_content_column_min_height_and_margin_bottom.rs +++ b/benches/generated/justify_content_column_min_height_and_margin_bottom.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,9 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() + }, + margin: taffy::geometry::Rect { + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { bottom: taffy::style::Dimension::Points(10f32), ..Default::default() }, ..Default::default() }, &[], @@ -19,10 +24,7 @@ pub fn compute() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, justify_content: taffy::style::JustifyContent::Center, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(50f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/justify_content_column_min_height_and_margin_top.rs b/benches/generated/justify_content_column_min_height_and_margin_top.rs index e0e377db5..cbcb384e9 100644 --- a/benches/generated/justify_content_column_min_height_and_margin_top.rs +++ b/benches/generated/justify_content_column_min_height_and_margin_top.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,9 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() + }, + margin: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Points(10f32), ..Default::default() }, ..Default::default() }, &[], @@ -19,10 +24,7 @@ pub fn compute() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, justify_content: taffy::style::JustifyContent::Center, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(50f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/justify_content_column_space_around.rs b/benches/generated/justify_content_column_space_around.rs index 8069bdf64..4aa425250 100644 --- a/benches/generated/justify_content_column_space_around.rs +++ b/benches/generated/justify_content_column_space_around.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/justify_content_column_space_between.rs b/benches/generated/justify_content_column_space_between.rs index acf2b059b..90ad834c6 100644 --- a/benches/generated/justify_content_column_space_between.rs +++ b/benches/generated/justify_content_column_space_between.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/justify_content_column_space_evenly.rs b/benches/generated/justify_content_column_space_evenly.rs index 797024d99..5edc9c866 100644 --- a/benches/generated/justify_content_column_space_evenly.rs +++ b/benches/generated/justify_content_column_space_evenly.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/justify_content_min_max.rs b/benches/generated/justify_content_min_max.rs index b49e5e930..597b09111 100644 --- a/benches/generated/justify_content_min_max.rs +++ b/benches/generated/justify_content_min_max.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(60f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -18,15 +20,9 @@ pub fn compute() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, justify_content: taffy::style::JustifyContent::Center, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(200f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/justify_content_min_width_with_padding_child_width_greater_than_parent.rs b/benches/generated/justify_content_min_width_with_padding_child_width_greater_than_parent.rs index 24a4ad99c..05323da84 100644 --- a/benches/generated/justify_content_min_width_with_padding_child_width_greater_than_parent.rs +++ b/benches/generated/justify_content_min_width_with_padding_child_width_greater_than_parent.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(300f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -17,14 +19,11 @@ pub fn compute() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::Center, - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(400f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(400f32), ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(100f32), - right: taffy::style::Dimension::Points(100f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(100f32), + right: taffy::style::LengthPercentage::Points(100f32), + ..Rect::zero() }, ..Default::default() }, @@ -39,7 +38,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(1000f32), height: taffy::style::Dimension::Points(1584f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/justify_content_min_width_with_padding_child_width_lower_than_parent.rs b/benches/generated/justify_content_min_width_with_padding_child_width_lower_than_parent.rs index 7e6522621..7da926ae4 100644 --- a/benches/generated/justify_content_min_width_with_padding_child_width_lower_than_parent.rs +++ b/benches/generated/justify_content_min_width_with_padding_child_width_lower_than_parent.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(199f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -17,14 +19,11 @@ pub fn compute() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::Center, - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(400f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(400f32), ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(100f32), - right: taffy::style::Dimension::Points(100f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(100f32), + right: taffy::style::LengthPercentage::Points(100f32), + ..Rect::zero() }, ..Default::default() }, @@ -39,7 +38,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(1080f32), height: taffy::style::Dimension::Points(1584f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/justify_content_overflow_min_max.rs b/benches/generated/justify_content_overflow_min_max.rs index 64d0f88a5..7827ffced 100644 --- a/benches/generated/justify_content_overflow_min_max.rs +++ b/benches/generated/justify_content_overflow_min_max.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -35,7 +37,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -47,14 +49,8 @@ pub fn compute() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, justify_content: taffy::style::JustifyContent::Center, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(110f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(110f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2], diff --git a/benches/generated/justify_content_row_center.rs b/benches/generated/justify_content_row_center.rs index 17e4b2287..56b6c6e58 100644 --- a/benches/generated/justify_content_row_center.rs +++ b/benches/generated/justify_content_row_center.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/justify_content_row_flex_end.rs b/benches/generated/justify_content_row_flex_end.rs index 8d47f7965..60caa6909 100644 --- a/benches/generated/justify_content_row_flex_end.rs +++ b/benches/generated/justify_content_row_flex_end.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/justify_content_row_flex_start.rs b/benches/generated/justify_content_row_flex_start.rs index 28769c015..3c41844d6 100644 --- a/benches/generated/justify_content_row_flex_start.rs +++ b/benches/generated/justify_content_row_flex_start.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -33,7 +35,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/justify_content_row_max_width_and_margin.rs b/benches/generated/justify_content_row_max_width_and_margin.rs index e5353f1b2..d7dfd8a19 100644 --- a/benches/generated/justify_content_row_max_width_and_margin.rs +++ b/benches/generated/justify_content_row_max_width_and_margin.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,9 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() + }, + margin: taffy::geometry::Rect { + left: taffy::style::LengthPercentageAuto::Points(100f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { left: taffy::style::Dimension::Points(100f32), ..Default::default() }, ..Default::default() }, &[], @@ -18,8 +23,8 @@ pub fn compute() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::Center, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, - max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/justify_content_row_min_width_and_margin.rs b/benches/generated/justify_content_row_min_width_and_margin.rs index 0af599913..e6fb775ba 100644 --- a/benches/generated/justify_content_row_min_width_and_margin.rs +++ b/benches/generated/justify_content_row_min_width_and_margin.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,9 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() + }, + margin: taffy::geometry::Rect { + left: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { left: taffy::style::Dimension::Points(10f32), ..Default::default() }, ..Default::default() }, &[], @@ -18,7 +23,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::Center, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/justify_content_row_space_around.rs b/benches/generated/justify_content_row_space_around.rs index dc709010c..8be9f4b8a 100644 --- a/benches/generated/justify_content_row_space_around.rs +++ b/benches/generated/justify_content_row_space_around.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/justify_content_row_space_between.rs b/benches/generated/justify_content_row_space_between.rs index 34a1c95d2..896f83000 100644 --- a/benches/generated/justify_content_row_space_between.rs +++ b/benches/generated/justify_content_row_space_between.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/justify_content_row_space_evenly.rs b/benches/generated/justify_content_row_space_evenly.rs index a8be8f580..84ffb89ef 100644 --- a/benches/generated/justify_content_row_space_evenly.rs +++ b/benches/generated/justify_content_row_space_evenly.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_and_flex_column.rs b/benches/generated/margin_and_flex_column.rs index b05d657a9..7ad5a445d 100644 --- a/benches/generated/margin_and_flex_column.rs +++ b/benches/generated/margin_and_flex_column.rs @@ -1,13 +1,15 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -21,7 +23,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_and_flex_row.rs b/benches/generated/margin_and_flex_row.rs index 559d83e5b..762c84acd 100644 --- a/benches/generated/margin_and_flex_row.rs +++ b/benches/generated/margin_and_flex_row.rs @@ -1,13 +1,15 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_and_stretch_column.rs b/benches/generated/margin_and_stretch_column.rs index 478d82e9b..ae9d8ca7c 100644 --- a/benches/generated/margin_and_stretch_column.rs +++ b/benches/generated/margin_and_stretch_column.rs @@ -1,13 +1,15 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -21,7 +23,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_and_stretch_row.rs b/benches/generated/margin_and_stretch_row.rs index 9cd29a2e3..eb9b22bd3 100644 --- a/benches/generated/margin_and_stretch_row.rs +++ b/benches/generated/margin_and_stretch_row.rs @@ -1,13 +1,15 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_bottom.rs b/benches/generated/margin_auto_bottom.rs index 29b827d77..62eed17ff 100644 --- a/benches/generated/margin_auto_bottom.rs +++ b/benches/generated/margin_auto_bottom.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,9 +8,9 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { bottom: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { bottom: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_bottom_and_top.rs b/benches/generated/margin_auto_bottom_and_top.rs index 3648ce3a7..e873ad1b0 100644 --- a/benches/generated/margin_auto_bottom_and_top.rs +++ b/benches/generated/margin_auto_bottom_and_top.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,12 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Auto, - bottom: taffy::style::Dimension::Auto, - ..Default::default() + top: taffy::style::LengthPercentageAuto::Auto, + bottom: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -24,7 +26,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -38,7 +40,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_bottom_and_top_justify_center.rs b/benches/generated/margin_auto_bottom_and_top_justify_center.rs index 8fdb51e41..9ca934c2d 100644 --- a/benches/generated/margin_auto_bottom_and_top_justify_center.rs +++ b/benches/generated/margin_auto_bottom_and_top_justify_center.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,12 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Auto, - bottom: taffy::style::Dimension::Auto, - ..Default::default() + top: taffy::style::LengthPercentageAuto::Auto, + bottom: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -24,7 +26,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -38,7 +40,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_left.rs b/benches/generated/margin_auto_left.rs index ac07b6780..9c154d85d 100644 --- a/benches/generated/margin_auto_left.rs +++ b/benches/generated/margin_auto_left.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,9 +8,9 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { left: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { left: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_left_and_right.rs b/benches/generated/margin_auto_left_and_right.rs index ed593a568..13fbccd69 100644 --- a/benches/generated/margin_auto_left_and_right.rs +++ b/benches/generated/margin_auto_left_and_right.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,12 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Auto, - right: taffy::style::Dimension::Auto, - ..Default::default() + left: taffy::style::LengthPercentageAuto::Auto, + right: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -24,7 +26,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -37,7 +39,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_left_and_right_column.rs b/benches/generated/margin_auto_left_and_right_column.rs index 95b5cf21e..ccd1598fa 100644 --- a/benches/generated/margin_auto_left_and_right_column.rs +++ b/benches/generated/margin_auto_left_and_right_column.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,12 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Auto, - right: taffy::style::Dimension::Auto, - ..Default::default() + left: taffy::style::LengthPercentageAuto::Auto, + right: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -24,7 +26,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -38,7 +40,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_left_and_right_column_and_center.rs b/benches/generated/margin_auto_left_and_right_column_and_center.rs index 95b5cf21e..ccd1598fa 100644 --- a/benches/generated/margin_auto_left_and_right_column_and_center.rs +++ b/benches/generated/margin_auto_left_and_right_column_and_center.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,12 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Auto, - right: taffy::style::Dimension::Auto, - ..Default::default() + left: taffy::style::LengthPercentageAuto::Auto, + right: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -24,7 +26,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -38,7 +40,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_left_and_right_strech.rs b/benches/generated/margin_auto_left_and_right_strech.rs index ed593a568..13fbccd69 100644 --- a/benches/generated/margin_auto_left_and_right_strech.rs +++ b/benches/generated/margin_auto_left_and_right_strech.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,12 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Auto, - right: taffy::style::Dimension::Auto, - ..Default::default() + left: taffy::style::LengthPercentageAuto::Auto, + right: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -24,7 +26,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -37,7 +39,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_left_child_bigger_than_parent.rs b/benches/generated/margin_auto_left_child_bigger_than_parent.rs index c75df0efe..dc4e6785f 100644 --- a/benches/generated/margin_auto_left_child_bigger_than_parent.rs +++ b/benches/generated/margin_auto_left_child_bigger_than_parent.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,9 +8,9 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(72f32), height: taffy::style::Dimension::Points(72f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { left: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { left: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(52f32), height: taffy::style::Dimension::Points(52f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_left_fix_right_child_bigger_than_parent.rs b/benches/generated/margin_auto_left_fix_right_child_bigger_than_parent.rs index 9e9e0404f..be7f449e4 100644 --- a/benches/generated/margin_auto_left_fix_right_child_bigger_than_parent.rs +++ b/benches/generated/margin_auto_left_fix_right_child_bigger_than_parent.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,12 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(72f32), height: taffy::style::Dimension::Points(72f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Auto, - right: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Auto, + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -25,7 +27,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(52f32), height: taffy::style::Dimension::Points(52f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_left_right_child_bigger_than_parent.rs b/benches/generated/margin_auto_left_right_child_bigger_than_parent.rs index 893e5d683..51d18b133 100644 --- a/benches/generated/margin_auto_left_right_child_bigger_than_parent.rs +++ b/benches/generated/margin_auto_left_right_child_bigger_than_parent.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,12 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(72f32), height: taffy::style::Dimension::Points(72f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Auto, - right: taffy::style::Dimension::Auto, - ..Default::default() + left: taffy::style::LengthPercentageAuto::Auto, + right: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -25,7 +27,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(52f32), height: taffy::style::Dimension::Points(52f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_left_stretching_child.rs b/benches/generated/margin_auto_left_stretching_child.rs index 1748e0584..d0abd6732 100644 --- a/benches/generated/margin_auto_left_stretching_child.rs +++ b/benches/generated/margin_auto_left_stretching_child.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { flex_grow: 1f32, flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), - margin: taffy::geometry::Rect { left: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { left: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -18,7 +20,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_mutiple_children_column.rs b/benches/generated/margin_auto_mutiple_children_column.rs index 6217a212e..16f6b1695 100644 --- a/benches/generated/margin_auto_mutiple_children_column.rs +++ b/benches/generated/margin_auto_mutiple_children_column.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,9 +8,9 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { top: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -20,9 +22,9 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { top: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -49,7 +51,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_mutiple_children_row.rs b/benches/generated/margin_auto_mutiple_children_row.rs index e75e2eb76..eee2c64c2 100644 --- a/benches/generated/margin_auto_mutiple_children_row.rs +++ b/benches/generated/margin_auto_mutiple_children_row.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,9 +8,9 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { right: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { right: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -20,9 +22,9 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { right: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { right: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -48,7 +50,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_right.rs b/benches/generated/margin_auto_right.rs index b2733a78d..700e9beae 100644 --- a/benches/generated/margin_auto_right.rs +++ b/benches/generated/margin_auto_right.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,9 +8,9 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { right: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { right: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_top.rs b/benches/generated/margin_auto_top.rs index e308e360c..3aaa1c5f5 100644 --- a/benches/generated/margin_auto_top.rs +++ b/benches/generated/margin_auto_top.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,9 +8,9 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { top: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,7 +36,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_top_and_bottom_strech.rs b/benches/generated/margin_auto_top_and_bottom_strech.rs index 13dd3f590..542e38b16 100644 --- a/benches/generated/margin_auto_top_and_bottom_strech.rs +++ b/benches/generated/margin_auto_top_and_bottom_strech.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,12 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Auto, - bottom: taffy::style::Dimension::Auto, - ..Default::default() + top: taffy::style::LengthPercentageAuto::Auto, + bottom: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -24,7 +26,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -38,7 +40,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_auto_top_stretching_child.rs b/benches/generated/margin_auto_top_stretching_child.rs index c08063041..fabfaaa8c 100644 --- a/benches/generated/margin_auto_top_stretching_child.rs +++ b/benches/generated/margin_auto_top_stretching_child.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { flex_grow: 1f32, flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { top: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -18,7 +20,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_bottom.rs b/benches/generated/margin_bottom.rs index 828e5b635..2633fe434 100644 --- a/benches/generated/margin_bottom.rs +++ b/benches/generated/margin_bottom.rs @@ -1,10 +1,15 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, - margin: taffy::geometry::Rect { bottom: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + margin: taffy::geometry::Rect { + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[], @@ -18,7 +23,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_fix_left_auto_right_child_bigger_than_parent.rs b/benches/generated/margin_fix_left_auto_right_child_bigger_than_parent.rs index 394618cec..ecac0fd78 100644 --- a/benches/generated/margin_fix_left_auto_right_child_bigger_than_parent.rs +++ b/benches/generated/margin_fix_left_auto_right_child_bigger_than_parent.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,12 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(72f32), height: taffy::style::Dimension::Points(72f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Auto, - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -25,7 +27,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(52f32), height: taffy::style::Dimension::Points(52f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_left.rs b/benches/generated/margin_left.rs index 9b42900c8..f1416709a 100644 --- a/benches/generated/margin_left.rs +++ b/benches/generated/margin_left.rs @@ -1,10 +1,15 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, - margin: taffy::geometry::Rect { left: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + margin: taffy::geometry::Rect { + left: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[], @@ -16,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_right.rs b/benches/generated/margin_right.rs index d138a0c5f..c51447ae6 100644 --- a/benches/generated/margin_right.rs +++ b/benches/generated/margin_right.rs @@ -1,10 +1,15 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, - margin: taffy::geometry::Rect { right: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + margin: taffy::geometry::Rect { + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[], @@ -17,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_should_not_be_part_of_max_height.rs b/benches/generated/margin_should_not_be_part_of_max_height.rs index cc2898b05..dc6585ca3 100644 --- a/benches/generated/margin_should_not_be_part_of_max_height.rs +++ b/benches/generated/margin_should_not_be_part_of_max_height.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,13 +8,13 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + margin: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(20f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Points(20f32), ..Default::default() }, ..Default::default() }, &[], @@ -24,7 +26,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(250f32), height: taffy::style::Dimension::Points(250f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_should_not_be_part_of_max_width.rs b/benches/generated/margin_should_not_be_part_of_max_width.rs index 0a848e8d3..70f6c41a5 100644 --- a/benches/generated/margin_should_not_be_part_of_max_width.rs +++ b/benches/generated/margin_should_not_be_part_of_max_width.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,13 +8,13 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + margin: taffy::geometry::Rect { + left: taffy::style::LengthPercentageAuto::Points(20f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { left: taffy::style::Dimension::Points(20f32), ..Default::default() }, ..Default::default() }, &[], @@ -24,7 +26,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(250f32), height: taffy::style::Dimension::Points(250f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_top.rs b/benches/generated/margin_top.rs index 993931106..38341f6e2 100644 --- a/benches/generated/margin_top.rs +++ b/benches/generated/margin_top.rs @@ -1,10 +1,15 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + margin: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[], @@ -17,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_with_sibling_column.rs b/benches/generated/margin_with_sibling_column.rs index 2ae7855f9..8a69575af 100644 --- a/benches/generated/margin_with_sibling_column.rs +++ b/benches/generated/margin_with_sibling_column.rs @@ -1,10 +1,15 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - margin: taffy::geometry::Rect { bottom: taffy::style::Dimension::Points(10f32), ..Default::default() }, + margin: taffy::geometry::Rect { + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[], @@ -18,7 +23,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/margin_with_sibling_row.rs b/benches/generated/margin_with_sibling_row.rs index a6415510d..8d0f58272 100644 --- a/benches/generated/margin_with_sibling_row.rs +++ b/benches/generated/margin_with_sibling_row.rs @@ -1,10 +1,15 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - margin: taffy::geometry::Rect { right: taffy::style::Dimension::Points(10f32), ..Default::default() }, + margin: taffy::geometry::Rect { + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[], @@ -17,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/max_height.rs b/benches/generated/max_height.rs index cf419324d..773156720 100644 --- a/benches/generated/max_height.rs +++ b/benches/generated/max_height.rs @@ -1,13 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(50f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -19,7 +18,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/max_height_overrides_height.rs b/benches/generated/max_height_overrides_height.rs index 78e3baf5a..9952c7809 100644 --- a/benches/generated/max_height_overrides_height.rs +++ b/benches/generated/max_height_overrides_height.rs @@ -1,13 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(200f32), ..Default::default() }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(200f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], diff --git a/benches/generated/max_height_overrides_height_on_root.rs b/benches/generated/max_height_overrides_height_on_root.rs index 8284102c1..89f212b79 100644 --- a/benches/generated/max_height_overrides_height_on_root.rs +++ b/benches/generated/max_height_overrides_height_on_root.rs @@ -1,13 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(200f32), ..Default::default() }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(200f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], diff --git a/benches/generated/max_width.rs b/benches/generated/max_width.rs index f87b2b1d0..cd060c923 100644 --- a/benches/generated/max_width.rs +++ b/benches/generated/max_width.rs @@ -1,10 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, - max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -17,7 +19,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/max_width_overrides_width.rs b/benches/generated/max_width_overrides_width.rs index 1ab60b5f4..0df2095d7 100644 --- a/benches/generated/max_width_overrides_width.rs +++ b/benches/generated/max_width_overrides_width.rs @@ -1,13 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Default::default() }, - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Size::auto() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], diff --git a/benches/generated/max_width_overrides_width_on_root.rs b/benches/generated/max_width_overrides_width_on_root.rs index 39e2f7158..a7924f7ed 100644 --- a/benches/generated/max_width_overrides_width_on_root.rs +++ b/benches/generated/max_width_overrides_width_on_root.rs @@ -1,13 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Default::default() }, - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Size::auto() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], diff --git a/benches/generated/min_height.rs b/benches/generated/min_height.rs index 5230e63df..a22e8b223 100644 --- a/benches/generated/min_height.rs +++ b/benches/generated/min_height.rs @@ -1,13 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(60f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -21,7 +20,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/min_height_overrides_height.rs b/benches/generated/min_height_overrides_height.rs index 57140cd43..863e0c541 100644 --- a/benches/generated/min_height_overrides_height.rs +++ b/benches/generated/min_height_overrides_height.rs @@ -1,13 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], diff --git a/benches/generated/min_height_overrides_height_on_root.rs b/benches/generated/min_height_overrides_height_on_root.rs index 0c9e5dc86..910535216 100644 --- a/benches/generated/min_height_overrides_height_on_root.rs +++ b/benches/generated/min_height_overrides_height_on_root.rs @@ -1,13 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], diff --git a/benches/generated/min_height_overrides_max_height.rs b/benches/generated/min_height_overrides_max_height.rs index 3cade50ed..786461a85 100644 --- a/benches/generated/min_height_overrides_max_height.rs +++ b/benches/generated/min_height_overrides_max_height.rs @@ -1,16 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(50f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], diff --git a/benches/generated/min_max_percent_no_width_height.rs b/benches/generated/min_max_percent_no_width_height.rs index c8c28da56..92a49aa09 100644 --- a/benches/generated/min_max_percent_no_width_height.rs +++ b/benches/generated/min_max_percent_no_width_height.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,12 +8,12 @@ pub fn compute() { min_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.1f32), height: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + ..Size::auto() }, max_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.1f32), height: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -26,7 +28,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/min_width.rs b/benches/generated/min_width.rs index 0f1653a48..42354f82d 100644 --- a/benches/generated/min_width.rs +++ b/benches/generated/min_width.rs @@ -1,10 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -17,7 +19,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/min_width_overrides_max_width.rs b/benches/generated/min_width_overrides_max_width.rs index 42544e84c..5851ad48d 100644 --- a/benches/generated/min_width_overrides_max_width.rs +++ b/benches/generated/min_width_overrides_max_width.rs @@ -1,13 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], diff --git a/benches/generated/min_width_overrides_width.rs b/benches/generated/min_width_overrides_width.rs index 65ba68fc9..a876f459b 100644 --- a/benches/generated/min_width_overrides_width.rs +++ b/benches/generated/min_width_overrides_width.rs @@ -1,13 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], diff --git a/benches/generated/min_width_overrides_width_on_root.rs b/benches/generated/min_width_overrides_width_on_root.rs index d86c62907..88751e18f 100644 --- a/benches/generated/min_width_overrides_width_on_root.rs +++ b/benches/generated/min_width_overrides_width_on_root.rs @@ -1,13 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], diff --git a/benches/generated/nested_overflowing_child.rs b/benches/generated/nested_overflowing_child.rs index a85edd890..cd4492620 100644 --- a/benches/generated/nested_overflowing_child.rs +++ b/benches/generated/nested_overflowing_child.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/nested_overflowing_child_in_constraint_parent.rs b/benches/generated/nested_overflowing_child_in_constraint_parent.rs index 95f659d36..12ef5db0e 100644 --- a/benches/generated/nested_overflowing_child_in_constraint_parent.rs +++ b/benches/generated/nested_overflowing_child_in_constraint_parent.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/overflow_cross_axis.rs b/benches/generated/overflow_cross_axis.rs index 06fe9b39e..2be73d813 100644 --- a/benches/generated/overflow_cross_axis.rs +++ b/benches/generated/overflow_cross_axis.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/overflow_main_axis.rs b/benches/generated/overflow_main_axis.rs index 574a5e9a9..066ffbcaa 100644 --- a/benches/generated/overflow_main_axis.rs +++ b/benches/generated/overflow_main_axis.rs @@ -1,10 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_shrink: 0f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,7 +18,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/padding_align_end_child.rs b/benches/generated/padding_align_end_child.rs index c516002bc..75958abd0 100644 --- a/benches/generated/padding_align_end_child.rs +++ b/benches/generated/padding_align_end_child.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,14 +8,14 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(20f32), - right: taffy::style::Dimension::Points(20f32), - top: taffy::style::Dimension::Points(20f32), - bottom: taffy::style::Dimension::Points(20f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(20f32), + right: taffy::style::LengthPercentage::Points(20f32), + top: taffy::style::LengthPercentage::Points(20f32), + bottom: taffy::style::LengthPercentage::Points(20f32), + ..Rect::zero() }, ..Default::default() }, @@ -28,7 +30,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/padding_center_child.rs b/benches/generated/padding_center_child.rs index b323a0826..36d471538 100644 --- a/benches/generated/padding_center_child.rs +++ b/benches/generated/padding_center_child.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,14 +23,14 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(20f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(20f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(20f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(20f32), + ..Rect::zero() }, ..Default::default() }, diff --git a/benches/generated/padding_flex_child.rs b/benches/generated/padding_flex_child.rs index 2d5152d42..31f523dff 100644 --- a/benches/generated/padding_flex_child.rs +++ b/benches/generated/padding_flex_child.rs @@ -1,10 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,14 +18,14 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, diff --git a/benches/generated/padding_no_child.rs b/benches/generated/padding_no_child.rs index 5ac1592c1..5ebde112f 100644 --- a/benches/generated/padding_no_child.rs +++ b/benches/generated/padding_no_child.rs @@ -1,14 +1,16 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node = taffy .new_with_children( taffy::style::Style { padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, diff --git a/benches/generated/padding_stretch_child.rs b/benches/generated/padding_stretch_child.rs index 2acb3aa82..a18ac244c 100644 --- a/benches/generated/padding_stretch_child.rs +++ b/benches/generated/padding_stretch_child.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -15,14 +17,14 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, diff --git a/benches/generated/parent_wrap_child_size_overflowing_parent.rs b/benches/generated/parent_wrap_child_size_overflowing_parent.rs index 284f54286..18582e8ae 100644 --- a/benches/generated/parent_wrap_child_size_overflowing_parent.rs +++ b/benches/generated/parent_wrap_child_size_overflowing_parent.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -16,7 +18,7 @@ pub fn compute() { let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node00], @@ -28,7 +30,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percent_absolute_position.rs b/benches/generated/percent_absolute_position.rs index f74374dd5..aee9ba17e 100644 --- a/benches/generated/percent_absolute_position.rs +++ b/benches/generated/percent_absolute_position.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node01 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Size::auto() }, ..Default::default() }, &[], @@ -25,11 +27,11 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Percent(0.5f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Percent(0.5f32), + ..Rect::auto() }, ..Default::default() }, @@ -43,7 +45,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percent_within_flex_grow.rs b/benches/generated/percent_within_flex_grow.rs index 542b68694..38266fed8 100644 --- a/benches/generated/percent_within_flex_grow.rs +++ b/benches/generated/percent_within_flex_grow.rs @@ -1,9 +1,11 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -12,7 +14,7 @@ pub fn compute() { let node10 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Size::auto() }, ..Default::default() }, &[], @@ -31,7 +33,7 @@ pub fn compute() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -43,7 +45,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(350f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_absolute_position.rs b/benches/generated/percentage_absolute_position.rs index 0e06f3776..b710729e5 100644 --- a/benches/generated/percentage_absolute_position.rs +++ b/benches/generated/percentage_absolute_position.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Percent(0.3f32), - top: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Percent(0.3f32), + top: taffy::style::LengthPercentageAuto::Percent(0.1f32), + ..Rect::auto() }, ..Default::default() }, @@ -26,7 +28,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_container_in_wrapping_container.rs b/benches/generated/percentage_container_in_wrapping_container.rs index 9739e7df6..1f6731e66 100644 --- a/benches/generated/percentage_container_in_wrapping_container.rs +++ b/benches/generated/percentage_container_in_wrapping_container.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,7 +32,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::Center, - size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Size::auto() }, ..Default::default() }, &[node000, node001], @@ -51,7 +53,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_flex_basis.rs b/benches/generated/percentage_flex_basis.rs index 5e3f44987..3c056d815 100644 --- a/benches/generated/percentage_flex_basis.rs +++ b/benches/generated/percentage_flex_basis.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -26,7 +28,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_flex_basis_cross.rs b/benches/generated/percentage_flex_basis_cross.rs index 5b59d51b9..89a31ffc9 100644 --- a/benches/generated/percentage_flex_basis_cross.rs +++ b/benches/generated/percentage_flex_basis_cross.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -27,7 +29,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_flex_basis_cross_max_height.rs b/benches/generated/percentage_flex_basis_cross_max_height.rs index df3130cdd..3e9d30abd 100644 --- a/benches/generated/percentage_flex_basis_cross_max_height.rs +++ b/benches/generated/percentage_flex_basis_cross_max_height.rs @@ -1,14 +1,13 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, ..Default::default() }, &[], @@ -19,10 +18,7 @@ pub fn compute() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Percent(0.2f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +31,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_flex_basis_cross_max_width.rs b/benches/generated/percentage_flex_basis_cross_max_width.rs index 3222bec07..c2d1d0b42 100644 --- a/benches/generated/percentage_flex_basis_cross_max_width.rs +++ b/benches/generated/percentage_flex_basis_cross_max_width.rs @@ -1,14 +1,13 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, ..Default::default() }, &[], @@ -19,10 +18,7 @@ pub fn compute() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Percent(0.15f32), - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +31,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_flex_basis_cross_min_height.rs b/benches/generated/percentage_flex_basis_cross_min_height.rs index 0a93c8c43..939303373 100644 --- a/benches/generated/percentage_flex_basis_cross_min_height.rs +++ b/benches/generated/percentage_flex_basis_cross_min_height.rs @@ -1,13 +1,12 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, ..Default::default() }, &[], @@ -17,10 +16,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 2f32, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Percent(0.1f32), ..Size::auto() }, ..Default::default() }, &[], @@ -33,7 +29,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_flex_basis_cross_min_width.rs b/benches/generated/percentage_flex_basis_cross_min_width.rs index 9e78dcfd3..dfd14e842 100644 --- a/benches/generated/percentage_flex_basis_cross_min_width.rs +++ b/benches/generated/percentage_flex_basis_cross_min_width.rs @@ -1,14 +1,13 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, ..Default::default() }, &[], @@ -19,10 +18,7 @@ pub fn compute() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Percent(0.15f32), - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +31,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_flex_basis_main_max_height.rs b/benches/generated/percentage_flex_basis_main_max_height.rs index 7cf992063..78dd58ca4 100644 --- a/benches/generated/percentage_flex_basis_main_max_height.rs +++ b/benches/generated/percentage_flex_basis_main_max_height.rs @@ -1,14 +1,13 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, ..Default::default() }, &[], @@ -19,10 +18,7 @@ pub fn compute() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Percent(0.2f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +30,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_flex_basis_main_max_width.rs b/benches/generated/percentage_flex_basis_main_max_width.rs index 08926aa14..dc334f3ab 100644 --- a/benches/generated/percentage_flex_basis_main_max_width.rs +++ b/benches/generated/percentage_flex_basis_main_max_width.rs @@ -1,14 +1,13 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Percent(0.15f32), - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, ..Default::default() }, &[], @@ -19,10 +18,7 @@ pub fn compute() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +30,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_flex_basis_main_min_width.rs b/benches/generated/percentage_flex_basis_main_min_width.rs index debe374bd..a985f260d 100644 --- a/benches/generated/percentage_flex_basis_main_min_width.rs +++ b/benches/generated/percentage_flex_basis_main_min_width.rs @@ -1,14 +1,13 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Percent(0.15f32), - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, ..Default::default() }, &[], @@ -19,10 +18,7 @@ pub fn compute() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +30,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_margin_should_calculate_based_only_on_width.rs b/benches/generated/percentage_margin_should_calculate_based_only_on_width.rs index d6aeacb33..a8ca06634 100644 --- a/benches/generated/percentage_margin_should_calculate_based_only_on_width.rs +++ b/benches/generated/percentage_margin_should_calculate_based_only_on_width.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,11 +21,11 @@ pub fn compute() { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Percent(0.1f32), - right: taffy::style::Dimension::Percent(0.1f32), - top: taffy::style::Dimension::Percent(0.1f32), - bottom: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Percent(0.1f32), + right: taffy::style::LengthPercentageAuto::Percent(0.1f32), + top: taffy::style::LengthPercentageAuto::Percent(0.1f32), + bottom: taffy::style::LengthPercentageAuto::Percent(0.1f32), + ..Rect::zero() }, ..Default::default() }, @@ -37,7 +39,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_multiple_nested_with_padding_margin_and_percentage_values.rs b/benches/generated/percentage_multiple_nested_with_padding_margin_and_percentage_values.rs index 6a6c874ba..a2edc9f2e 100644 --- a/benches/generated/percentage_multiple_nested_with_padding_margin_and_percentage_values.rs +++ b/benches/generated/percentage_multiple_nested_with_padding_margin_and_percentage_values.rs @@ -1,22 +1,24 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.45f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.45f32), ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Percent(0.05f32), - right: taffy::style::Dimension::Percent(0.05f32), - top: taffy::style::Dimension::Percent(0.05f32), - bottom: taffy::style::Dimension::Percent(0.05f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Percent(0.05f32), + right: taffy::style::LengthPercentageAuto::Percent(0.05f32), + top: taffy::style::LengthPercentageAuto::Percent(0.05f32), + bottom: taffy::style::LengthPercentageAuto::Percent(0.05f32), + ..Rect::zero() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(3f32), - right: taffy::style::Dimension::Points(3f32), - top: taffy::style::Dimension::Points(3f32), - bottom: taffy::style::Dimension::Points(3f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(3f32), + right: taffy::style::LengthPercentage::Points(3f32), + top: taffy::style::LengthPercentage::Points(3f32), + bottom: taffy::style::LengthPercentage::Points(3f32), + ..Rect::zero() }, ..Default::default() }, @@ -27,20 +29,20 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.5f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.5f32), ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(5f32), - right: taffy::style::Dimension::Points(5f32), - top: taffy::style::Dimension::Points(5f32), - bottom: taffy::style::Dimension::Points(5f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(5f32), + right: taffy::style::LengthPercentageAuto::Points(5f32), + top: taffy::style::LengthPercentageAuto::Points(5f32), + bottom: taffy::style::LengthPercentageAuto::Points(5f32), + ..Rect::zero() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Percent(0.03f32), - right: taffy::style::Dimension::Percent(0.03f32), - top: taffy::style::Dimension::Percent(0.03f32), - bottom: taffy::style::Dimension::Percent(0.03f32), - ..Default::default() + left: taffy::style::LengthPercentage::Percent(0.03f32), + right: taffy::style::LengthPercentage::Percent(0.03f32), + top: taffy::style::LengthPercentage::Percent(0.03f32), + bottom: taffy::style::LengthPercentage::Percent(0.03f32), + ..Rect::zero() }, ..Default::default() }, @@ -53,23 +55,20 @@ pub fn compute() { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(5f32), - right: taffy::style::Dimension::Points(5f32), - top: taffy::style::Dimension::Points(5f32), - bottom: taffy::style::Dimension::Points(5f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(5f32), + right: taffy::style::LengthPercentageAuto::Points(5f32), + top: taffy::style::LengthPercentageAuto::Points(5f32), + bottom: taffy::style::LengthPercentageAuto::Points(5f32), + ..Rect::zero() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(3f32), - right: taffy::style::Dimension::Points(3f32), - top: taffy::style::Dimension::Points(3f32), - bottom: taffy::style::Dimension::Points(3f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(3f32), + right: taffy::style::LengthPercentage::Points(3f32), + top: taffy::style::LengthPercentage::Points(3f32), + bottom: taffy::style::LengthPercentage::Points(3f32), + ..Rect::zero() }, ..Default::default() }, @@ -81,10 +80,7 @@ pub fn compute() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Percent(0.15f32), - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Size::auto() }, ..Default::default() }, &[], @@ -97,7 +93,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_padding_should_calculate_based_only_on_width.rs b/benches/generated/percentage_padding_should_calculate_based_only_on_width.rs index 417459abe..6118a51f7 100644 --- a/benches/generated/percentage_padding_should_calculate_based_only_on_width.rs +++ b/benches/generated/percentage_padding_should_calculate_based_only_on_width.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,11 +21,11 @@ pub fn compute() { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Percent(0.1f32), - right: taffy::style::Dimension::Percent(0.1f32), - top: taffy::style::Dimension::Percent(0.1f32), - bottom: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + left: taffy::style::LengthPercentage::Percent(0.1f32), + right: taffy::style::LengthPercentage::Percent(0.1f32), + top: taffy::style::LengthPercentage::Percent(0.1f32), + bottom: taffy::style::LengthPercentage::Percent(0.1f32), + ..Rect::zero() }, ..Default::default() }, @@ -37,7 +39,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_position_bottom_right.rs b/benches/generated/percentage_position_bottom_right.rs index 6a3a80472..9c70838de 100644 --- a/benches/generated/percentage_position_bottom_right.rs +++ b/benches/generated/percentage_position_bottom_right.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,12 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.55f32), height: taffy::style::Dimension::Percent(0.15f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - right: taffy::style::Dimension::Percent(0.2f32), - bottom: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + right: taffy::style::LengthPercentageAuto::Percent(0.2f32), + bottom: taffy::style::LengthPercentageAuto::Percent(0.1f32), + ..Rect::auto() }, ..Default::default() }, @@ -24,7 +26,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_position_left_top.rs b/benches/generated/percentage_position_left_top.rs index c270080c3..723c19956 100644 --- a/benches/generated/percentage_position_left_top.rs +++ b/benches/generated/percentage_position_left_top.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,12 +8,12 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.45f32), height: taffy::style::Dimension::Percent(0.55f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Percent(0.1f32), - top: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Percent(0.1f32), + top: taffy::style::LengthPercentageAuto::Percent(0.2f32), + ..Rect::auto() }, ..Default::default() }, @@ -24,7 +26,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(400f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_size_based_on_parent_inner_size.rs b/benches/generated/percentage_size_based_on_parent_inner_size.rs index 0d4c1e4d3..41702cab4 100644 --- a/benches/generated/percentage_size_based_on_parent_inner_size.rs +++ b/benches/generated/percentage_size_based_on_parent_inner_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.5f32), height: taffy::style::Dimension::Percent(0.5f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,14 +22,14 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(20f32), - right: taffy::style::Dimension::Points(20f32), - top: taffy::style::Dimension::Points(20f32), - bottom: taffy::style::Dimension::Points(20f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(20f32), + right: taffy::style::LengthPercentage::Points(20f32), + top: taffy::style::LengthPercentage::Points(20f32), + bottom: taffy::style::LengthPercentage::Points(20f32), + ..Rect::zero() }, ..Default::default() }, diff --git a/benches/generated/percentage_size_of_flex_basis.rs b/benches/generated/percentage_size_of_flex_basis.rs index 7d907f6ff..be582e167 100644 --- a/benches/generated/percentage_size_of_flex_basis.rs +++ b/benches/generated/percentage_size_of_flex_basis.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,7 +24,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0], diff --git a/benches/generated/percentage_width_height.rs b/benches/generated/percentage_width_height.rs index d5c89f5a1..ffcacb882 100644 --- a/benches/generated/percentage_width_height.rs +++ b/benches/generated/percentage_width_height.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.3f32), height: taffy::style::Dimension::Percent(0.3f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/percentage_width_height_undefined_parent_size.rs b/benches/generated/percentage_width_height_undefined_parent_size.rs index 3e4fdf978..2b7706699 100644 --- a/benches/generated/percentage_width_height_undefined_parent_size.rs +++ b/benches/generated/percentage_width_height_undefined_parent_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.5f32), height: taffy::style::Dimension::Percent(0.5f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/relative_position_should_not_nudge_siblings.rs b/benches/generated/relative_position_should_not_nudge_siblings.rs index abdbd651c..2e29c7393 100644 --- a/benches/generated/relative_position_should_not_nudge_siblings.rs +++ b/benches/generated/relative_position_should_not_nudge_siblings.rs @@ -1,10 +1,15 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, - position: taffy::geometry::Rect { top: taffy::style::Dimension::Points(15f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + position: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(15f32), + ..Rect::auto() + }, ..Default::default() }, &[], @@ -13,8 +18,11 @@ pub fn compute() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, - position: taffy::geometry::Rect { top: taffy::style::Dimension::Points(15f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + position: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(15f32), + ..Rect::auto() + }, ..Default::default() }, &[], @@ -27,7 +35,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/rounding_flex_basis_flex_grow_row_prime_number_width.rs b/benches/generated/rounding_flex_basis_flex_grow_row_prime_number_width.rs index 088212a41..0bd5a8178 100644 --- a/benches/generated/rounding_flex_basis_flex_grow_row_prime_number_width.rs +++ b/benches/generated/rounding_flex_basis_flex_grow_row_prime_number_width.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); @@ -11,7 +13,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(113f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/rounding_flex_basis_flex_grow_row_width_of_100.rs b/benches/generated/rounding_flex_basis_flex_grow_row_width_of_100.rs index 08d30daea..f8b0aa330 100644 --- a/benches/generated/rounding_flex_basis_flex_grow_row_width_of_100.rs +++ b/benches/generated/rounding_flex_basis_flex_grow_row_width_of_100.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); @@ -9,7 +11,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/rounding_flex_basis_flex_shrink_row.rs b/benches/generated/rounding_flex_basis_flex_shrink_row.rs index 67d022098..9260874f0 100644 --- a/benches/generated/rounding_flex_basis_flex_shrink_row.rs +++ b/benches/generated/rounding_flex_basis_flex_shrink_row.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -28,7 +30,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(101f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/rounding_flex_basis_overrides_main_size.rs b/benches/generated/rounding_flex_basis_overrides_main_size.rs index b0df9f7ad..bd6aa8608 100644 --- a/benches/generated/rounding_flex_basis_overrides_main_size.rs +++ b/benches/generated/rounding_flex_basis_overrides_main_size.rs @@ -1,11 +1,13 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -15,7 +17,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -25,7 +27,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -38,7 +40,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(113f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/rounding_fractial_input_1.rs b/benches/generated/rounding_fractial_input_1.rs index 4521d6085..9f6669bb3 100644 --- a/benches/generated/rounding_fractial_input_1.rs +++ b/benches/generated/rounding_fractial_input_1.rs @@ -1,11 +1,13 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -15,7 +17,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -25,7 +27,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -38,7 +40,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(113.4f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/rounding_fractial_input_2.rs b/benches/generated/rounding_fractial_input_2.rs index 86388138f..fcc673533 100644 --- a/benches/generated/rounding_fractial_input_2.rs +++ b/benches/generated/rounding_fractial_input_2.rs @@ -1,11 +1,13 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -15,7 +17,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -25,7 +27,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -38,7 +40,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(113.6f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/rounding_fractial_input_3.rs b/benches/generated/rounding_fractial_input_3.rs index 4521d6085..9f6669bb3 100644 --- a/benches/generated/rounding_fractial_input_3.rs +++ b/benches/generated/rounding_fractial_input_3.rs @@ -1,11 +1,13 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -15,7 +17,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -25,7 +27,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -38,7 +40,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(113.4f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/rounding_fractial_input_4.rs b/benches/generated/rounding_fractial_input_4.rs index 4521d6085..9f6669bb3 100644 --- a/benches/generated/rounding_fractial_input_4.rs +++ b/benches/generated/rounding_fractial_input_4.rs @@ -1,11 +1,13 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -15,7 +17,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -25,7 +27,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -38,7 +40,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(113.4f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/rounding_total_fractial.rs b/benches/generated/rounding_total_fractial.rs index 052e20e8f..a5633f617 100644 --- a/benches/generated/rounding_total_fractial.rs +++ b/benches/generated/rounding_total_fractial.rs @@ -1,11 +1,13 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 0.7f32, flex_basis: taffy::style::Dimension::Points(50.3f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20.3f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20.3f32), ..Size::auto() }, ..Default::default() }, &[], @@ -15,7 +17,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1.6f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -25,7 +27,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1.1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10.7f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10.7f32), ..Size::auto() }, ..Default::default() }, &[], @@ -38,7 +40,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(87.4f32), height: taffy::style::Dimension::Points(113.4f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/rounding_total_fractial_nested.rs b/benches/generated/rounding_total_fractial_nested.rs index 0a94d6d37..c51f6ecef 100644 --- a/benches/generated/rounding_total_fractial_nested.rs +++ b/benches/generated/rounding_total_fractial_nested.rs @@ -1,14 +1,16 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(0.3f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(9.9f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(9.9f32), ..Size::auto() }, position: taffy::geometry::Rect { - bottom: taffy::style::Dimension::Points(13.3f32), - ..Default::default() + bottom: taffy::style::LengthPercentageAuto::Points(13.3f32), + ..Rect::auto() }, ..Default::default() }, @@ -20,8 +22,11 @@ pub fn compute() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Points(0.3f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(1.1f32), ..Default::default() }, - position: taffy::geometry::Rect { top: taffy::style::Dimension::Points(13.3f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(1.1f32), ..Size::auto() }, + position: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(13.3f32), + ..Rect::auto() + }, ..Default::default() }, &[], @@ -33,7 +38,7 @@ pub fn compute() { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 0.7f32, flex_basis: taffy::style::Dimension::Points(50.3f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20.3f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20.3f32), ..Size::auto() }, ..Default::default() }, &[node00, node01], @@ -43,7 +48,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1.6f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -53,7 +58,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_grow: 1.1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10.7f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10.7f32), ..Size::auto() }, ..Default::default() }, &[], @@ -66,7 +71,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(87.4f32), height: taffy::style::Dimension::Points(113.4f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/size_defined_by_child.rs b/benches/generated/size_defined_by_child.rs index 4b3f8d8ad..1031a9172 100644 --- a/benches/generated/size_defined_by_child.rs +++ b/benches/generated/size_defined_by_child.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/size_defined_by_child_with_border.rs b/benches/generated/size_defined_by_child_with_border.rs index 2636a1d1d..fbd3bfd6b 100644 --- a/benches/generated/size_defined_by_child_with_border.rs +++ b/benches/generated/size_defined_by_child_with_border.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -17,11 +19,11 @@ pub fn compute() { .new_with_children( taffy::style::Style { border: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, diff --git a/benches/generated/size_defined_by_child_with_padding.rs b/benches/generated/size_defined_by_child_with_padding.rs index 63d5cfdd4..46bd791e2 100644 --- a/benches/generated/size_defined_by_child_with_padding.rs +++ b/benches/generated/size_defined_by_child_with_padding.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -17,11 +19,11 @@ pub fn compute() { .new_with_children( taffy::style::Style { padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, diff --git a/benches/generated/size_defined_by_grand_child.rs b/benches/generated/size_defined_by_grand_child.rs index b9050d40e..963953e26 100644 --- a/benches/generated/size_defined_by_grand_child.rs +++ b/benches/generated/size_defined_by_grand_child.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/width_smaller_then_content_with_flex_grow_large_size.rs b/benches/generated/width_smaller_then_content_with_flex_grow_large_size.rs index dc257695d..a28aa623a 100644 --- a/benches/generated/width_smaller_then_content_with_flex_grow_large_size.rs +++ b/benches/generated/width_smaller_then_content_with_flex_grow_large_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -18,7 +20,7 @@ pub fn compute() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node00], @@ -30,7 +32,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -42,7 +44,7 @@ pub fn compute() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node10], @@ -51,7 +53,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/width_smaller_then_content_with_flex_grow_small_size.rs b/benches/generated/width_smaller_then_content_with_flex_grow_small_size.rs index bdb7040cc..e7b400f17 100644 --- a/benches/generated/width_smaller_then_content_with_flex_grow_small_size.rs +++ b/benches/generated/width_smaller_then_content_with_flex_grow_small_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -18,7 +20,7 @@ pub fn compute() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node00], @@ -30,7 +32,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -42,7 +44,7 @@ pub fn compute() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node10], @@ -51,7 +53,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/width_smaller_then_content_with_flex_grow_unconstraint_size.rs b/benches/generated/width_smaller_then_content_with_flex_grow_unconstraint_size.rs index c9f636a47..16179d9d4 100644 --- a/benches/generated/width_smaller_then_content_with_flex_grow_unconstraint_size.rs +++ b/benches/generated/width_smaller_then_content_with_flex_grow_unconstraint_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -18,7 +20,7 @@ pub fn compute() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node00], @@ -30,7 +32,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -42,7 +44,7 @@ pub fn compute() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node10], diff --git a/benches/generated/width_smaller_then_content_with_flex_grow_very_large_size.rs b/benches/generated/width_smaller_then_content_with_flex_grow_very_large_size.rs index 7861ce6dc..014591464 100644 --- a/benches/generated/width_smaller_then_content_with_flex_grow_very_large_size.rs +++ b/benches/generated/width_smaller_then_content_with_flex_grow_very_large_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -18,7 +20,7 @@ pub fn compute() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node00], @@ -30,7 +32,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -42,7 +44,7 @@ pub fn compute() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node10], @@ -51,7 +53,7 @@ pub fn compute() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], diff --git a/benches/generated/wrap_column.rs b/benches/generated/wrap_column.rs index bafbea96a..6e6ad58b8 100644 --- a/benches/generated/wrap_column.rs +++ b/benches/generated/wrap_column.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(31f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(32f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(33f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(34f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -60,7 +62,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/wrap_nodes_with_content_sizing_margin_cross.rs b/benches/generated/wrap_nodes_with_content_sizing_margin_cross.rs index 8ce5851dd..70e028c62 100644 --- a/benches/generated/wrap_nodes_with_content_sizing_margin_cross.rs +++ b/benches/generated/wrap_nodes_with_content_sizing_margin_cross.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(40f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -25,7 +27,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(40f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -36,7 +38,10 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Points(10f32), ..Default::default() }, + margin: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[node010], @@ -46,7 +51,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), ..Size::auto() }, ..Default::default() }, &[node00, node01], @@ -59,7 +64,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/wrap_nodes_with_content_sizing_overflowing_margin.rs b/benches/generated/wrap_nodes_with_content_sizing_overflowing_margin.rs index 36773c8c6..c1ea47059 100644 --- a/benches/generated/wrap_nodes_with_content_sizing_overflowing_margin.rs +++ b/benches/generated/wrap_nodes_with_content_sizing_overflowing_margin.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(40f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -25,7 +27,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(40f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -36,7 +38,10 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - margin: taffy::geometry::Rect { right: taffy::style::Dimension::Points(10f32), ..Default::default() }, + margin: taffy::geometry::Rect { + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[node010], @@ -46,7 +51,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(85f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(85f32), ..Size::auto() }, ..Default::default() }, &[node00, node01], @@ -59,7 +64,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/wrap_reverse_column.rs b/benches/generated/wrap_reverse_column.rs index 5d51feac0..f8f2bffe6 100644 --- a/benches/generated/wrap_reverse_column.rs +++ b/benches/generated/wrap_reverse_column.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(31f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(32f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(33f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(34f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -60,7 +62,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/wrap_reverse_column_fixed_size.rs b/benches/generated/wrap_reverse_column_fixed_size.rs index 890c5cc9a..9b4cf9e05 100644 --- a/benches/generated/wrap_reverse_column_fixed_size.rs +++ b/benches/generated/wrap_reverse_column_fixed_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -74,7 +76,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/wrap_reverse_row.rs b/benches/generated/wrap_reverse_row.rs index 11fde4b73..76481326f 100644 --- a/benches/generated/wrap_reverse_row.rs +++ b/benches/generated/wrap_reverse_row.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(31f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(32f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(33f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(34f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -56,7 +58,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::WrapReverse, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3], diff --git a/benches/generated/wrap_reverse_row_align_content_center.rs b/benches/generated/wrap_reverse_row_align_content_center.rs index 163faaeb2..0c705506e 100644 --- a/benches/generated/wrap_reverse_row_align_content_center.rs +++ b/benches/generated/wrap_reverse_row_align_content_center.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -70,7 +72,7 @@ pub fn compute() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::WrapReverse, align_content: taffy::style::AlignContent::Center, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3, node4], diff --git a/benches/generated/wrap_reverse_row_align_content_flex_start.rs b/benches/generated/wrap_reverse_row_align_content_flex_start.rs index 018c40f4d..ff6a3d818 100644 --- a/benches/generated/wrap_reverse_row_align_content_flex_start.rs +++ b/benches/generated/wrap_reverse_row_align_content_flex_start.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -70,7 +72,7 @@ pub fn compute() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::WrapReverse, align_content: taffy::style::AlignContent::FlexStart, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3, node4], diff --git a/benches/generated/wrap_reverse_row_align_content_space_around.rs b/benches/generated/wrap_reverse_row_align_content_space_around.rs index 6dcaeb77a..dec703cff 100644 --- a/benches/generated/wrap_reverse_row_align_content_space_around.rs +++ b/benches/generated/wrap_reverse_row_align_content_space_around.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -70,7 +72,7 @@ pub fn compute() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::WrapReverse, align_content: taffy::style::AlignContent::SpaceAround, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3, node4], diff --git a/benches/generated/wrap_reverse_row_align_content_stretch.rs b/benches/generated/wrap_reverse_row_align_content_stretch.rs index 0e7acdcff..0480eb5ef 100644 --- a/benches/generated/wrap_reverse_row_align_content_stretch.rs +++ b/benches/generated/wrap_reverse_row_align_content_stretch.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -69,7 +71,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::WrapReverse, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3, node4], diff --git a/benches/generated/wrap_reverse_row_single_line_different_size.rs b/benches/generated/wrap_reverse_row_single_line_different_size.rs index 985513f15..7f0d73f51 100644 --- a/benches/generated/wrap_reverse_row_single_line_different_size.rs +++ b/benches/generated/wrap_reverse_row_single_line_different_size.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -70,7 +72,7 @@ pub fn compute() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::WrapReverse, align_content: taffy::style::AlignContent::FlexStart, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(300f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(300f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3, node4], diff --git a/benches/generated/wrap_row.rs b/benches/generated/wrap_row.rs index 9995b1c30..8723125c3 100644 --- a/benches/generated/wrap_row.rs +++ b/benches/generated/wrap_row.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(31f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(32f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(33f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(34f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -56,7 +58,7 @@ pub fn compute() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3], diff --git a/benches/generated/wrap_row_align_items_center.rs b/benches/generated/wrap_row_align_items_center.rs index 2d4927364..1b36db731 100644 --- a/benches/generated/wrap_row_align_items_center.rs +++ b/benches/generated/wrap_row_align_items_center.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -57,7 +59,7 @@ pub fn compute() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, align_items: taffy::style::AlignItems::Center, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3], diff --git a/benches/generated/wrap_row_align_items_flex_end.rs b/benches/generated/wrap_row_align_items_flex_end.rs index f8bc96c60..016078517 100644 --- a/benches/generated/wrap_row_align_items_flex_end.rs +++ b/benches/generated/wrap_row_align_items_flex_end.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,7 +34,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,7 +47,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -57,7 +59,7 @@ pub fn compute() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, align_items: taffy::style::AlignItems::FlexEnd, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3], diff --git a/benches/generated/wrapped_column_max_height.rs b/benches/generated/wrapped_column_max_height.rs index 18e7cc59e..4cdea6477 100644 --- a/benches/generated/wrapped_column_max_height.rs +++ b/benches/generated/wrapped_column_max_height.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -6,12 +8,9 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[], @@ -23,14 +22,14 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(20f32), - right: taffy::style::Dimension::Points(20f32), - top: taffy::style::Dimension::Points(20f32), - bottom: taffy::style::Dimension::Points(20f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(20f32), + right: taffy::style::LengthPercentageAuto::Points(20f32), + top: taffy::style::LengthPercentageAuto::Points(20f32), + bottom: taffy::style::LengthPercentageAuto::Points(20f32), + ..Rect::zero() }, ..Default::default() }, @@ -43,7 +42,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -61,7 +60,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(700f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/wrapped_column_max_height_flex.rs b/benches/generated/wrapped_column_max_height_flex.rs index c2b871a23..3d5a621ed 100644 --- a/benches/generated/wrapped_column_max_height_flex.rs +++ b/benches/generated/wrapped_column_max_height_flex.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -9,12 +11,9 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[], @@ -29,14 +28,14 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(20f32), - right: taffy::style::Dimension::Points(20f32), - top: taffy::style::Dimension::Points(20f32), - bottom: taffy::style::Dimension::Points(20f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(20f32), + right: taffy::style::LengthPercentageAuto::Points(20f32), + top: taffy::style::LengthPercentageAuto::Points(20f32), + bottom: taffy::style::LengthPercentageAuto::Points(20f32), + ..Rect::zero() }, ..Default::default() }, @@ -49,7 +48,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -67,7 +66,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(700f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/wrapped_row_within_align_items_center.rs b/benches/generated/wrapped_row_within_align_items_center.rs index 1ceb0c6a3..53046ed7a 100644 --- a/benches/generated/wrapped_row_within_align_items_center.rs +++ b/benches/generated/wrapped_row_within_align_items_center.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(150f32), height: taffy::style::Dimension::Points(80f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), height: taffy::style::Dimension::Points(80f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -40,7 +42,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/wrapped_row_within_align_items_flex_end.rs b/benches/generated/wrapped_row_within_align_items_flex_end.rs index 9d047cfbe..d0fa4da7c 100644 --- a/benches/generated/wrapped_row_within_align_items_flex_end.rs +++ b/benches/generated/wrapped_row_within_align_items_flex_end.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(150f32), height: taffy::style::Dimension::Points(80f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), height: taffy::style::Dimension::Points(80f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -40,7 +42,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/benches/generated/wrapped_row_within_align_items_flex_start.rs b/benches/generated/wrapped_row_within_align_items_flex_start.rs index dd95165d1..0e92f720e 100644 --- a/benches/generated/wrapped_row_within_align_items_flex_start.rs +++ b/benches/generated/wrapped_row_within_align_items_flex_start.rs @@ -1,4 +1,6 @@ pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -6,7 +8,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(150f32), height: taffy::style::Dimension::Points(80f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), height: taffy::style::Dimension::Points(80f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -40,7 +42,7 @@ pub fn compute() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, diff --git a/examples/flexbox-gap.rs b/examples/flexbox-gap.rs index 6992df90d..78ec4f337 100644 --- a/examples/flexbox-gap.rs +++ b/examples/flexbox-gap.rs @@ -6,14 +6,13 @@ use taffy::prelude::*; fn main() -> Result<(), taffy::error::TaffyError> { let mut taffy = Taffy::new(); - let child_style = - Style { size: Size { width: Dimension::Points(20.0), height: Dimension::Points(20.0) }, ..Default::default() }; + let child_style = Style { size: Size { width: points(20.0), height: points(20.0) }, ..Default::default() }; let child0 = taffy.new_leaf(child_style.clone())?; let child1 = taffy.new_leaf(child_style.clone())?; let child2 = taffy.new_leaf(child_style.clone())?; let root = taffy.new_with_children( - Style { gap: Size { width: Dimension::Points(10.0), height: Dimension::Undefined }, ..Default::default() }, + Style { gap: Size { width: points(10.0), height: zero() }, ..Default::default() }, &[child0, child1, child2], )?; diff --git a/scripts/gentest/src/main.rs b/scripts/gentest/src/main.rs index cb793a11b..41d6c0f70 100644 --- a/scripts/gentest/src/main.rs +++ b/scripts/gentest/src/main.rs @@ -155,6 +155,8 @@ fn generate_bench(description: &json::JsonValue) -> TokenStream { quote!( pub fn compute() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); #node_description taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); @@ -171,9 +173,16 @@ fn generate_test(name: impl AsRef, description: &json::JsonValue) -> TokenS quote!( #[test] fn #name() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); #node_description taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); + #assertions } ) @@ -210,6 +219,47 @@ fn generate_assertions(ident: &str, node: &json::JsonValue) -> TokenStream { ) } +macro_rules! dim_quoted_renamed { + ($obj:ident, $in_name:ident, $out_name:ident, $value_mapper:ident) => { + let $out_name = match $obj.get(stringify!($in_name)) { + Some(json::JsonValue::Object(ref value)) => { + let dim = $value_mapper(value); + quote!($out_name: #dim,) + } + _ => quote!(), + }; + }; +} + +macro_rules! dim_quoted { + ($obj:ident, $dim_name:ident, $value_mapper: ident) => { + dim_quoted_renamed!($obj, $dim_name, $dim_name, $value_mapper) + }; +} + +macro_rules! edges_quoted { + ($style:ident, $val:ident, $value_mapper:ident, $default_value: expr) => { + let $val = match $style[stringify!($val)] { + json::JsonValue::Object(ref value) => { + dim_quoted!(value, left, $value_mapper); + dim_quoted!(value, right, $value_mapper); + dim_quoted!(value, top, $value_mapper); + dim_quoted!(value, bottom, $value_mapper); + + let def = $default_value; + + let edges = quote!(taffy::geometry::Rect { + #left #right #top #bottom + ..#def + }); + + quote!($val: #edges,) + }, + _ => quote!(), + }; + }; +} + fn generate_node(ident: &str, node: &json::JsonValue) -> TokenStream { let style = &node["style"]; @@ -410,22 +460,10 @@ fn generate_node(ident: &str, node: &json::JsonValue) -> TokenStream { let grid_column_start = quote_object_prop("grid_column_start", style, generate_grid_position); let grid_column_end = quote_object_prop("grid_column_end", style, generate_grid_position); - macro_rules! edges_quoted { - ($style:ident, $val:ident) => { - let $val = match $style[stringify!($val)] { - json::JsonValue::Object(ref value) => { - let edges = generate_edges(value); - quote!($val: #edges,) - }, - _ => quote!(), - }; - }; - } - - edges_quoted!(style, margin); - edges_quoted!(style, padding); - edges_quoted!(style, position); - edges_quoted!(style, border); + edges_quoted!(style, margin, generate_length_percentage_auto, quote!(Rect::zero())); + edges_quoted!(style, padding, generate_length_percentage, quote!(Rect::zero())); + edges_quoted!(style, border, generate_length_percentage, quote!(Rect::zero())); + edges_quoted!(style, position, generate_length_percentage_auto, quote!(Rect::auto())); let (children_body, children) = match node["children"] { json::JsonValue::Array(ref value) => { @@ -491,46 +529,69 @@ fn generate_node(ident: &str, node: &json::JsonValue) -> TokenStream { ).unwrap();) } -macro_rules! dim_quoted_renamed { - ($obj:ident, $in_name:ident, $out_name:ident) => { - let $out_name = match $obj.get(stringify!($in_name)) { - Some(json::JsonValue::Object(ref value)) => { - let dim = generate_dimension(value); - quote!($out_name: #dim,) - } - _ => quote!(), - }; - }; -} - -macro_rules! dim_quoted { - ($obj:ident, $dim_name:ident) => { - dim_quoted_renamed!($obj, $dim_name, $dim_name) - }; -} - fn generate_size(size: &json::object::Object) -> TokenStream { - dim_quoted!(size, width); - dim_quoted!(size, height); + dim_quoted!(size, width, generate_dimension); + dim_quoted!(size, height, generate_dimension); quote!( taffy::geometry::Size { #width #height - ..Default::default() + ..Size::auto() } ) } fn generate_gap(size: &json::object::Object) -> TokenStream { - dim_quoted_renamed!(size, column, width); - dim_quoted_renamed!(size, row, height); + dim_quoted_renamed!(size, column, width, generate_length_percentage); + dim_quoted_renamed!(size, row, height, generate_length_percentage); quote!( taffy::geometry::Size { #width #height - ..Default::default() + ..Size::zero() } ) } +fn generate_length_percentage(dimen: &json::object::Object) -> TokenStream { + let unit = dimen.get("unit").unwrap(); + let value = || dimen.get("value").unwrap().as_f32().unwrap(); + + match unit { + json::JsonValue::Short(ref unit) => match unit.as_ref() { + "points" => { + let value = value(); + quote!(taffy::style::LengthPercentage::Points(#value)) + } + "percent" => { + let value = value(); + quote!(taffy::style::LengthPercentage::Percent(#value)) + } + _ => unreachable!(), + }, + _ => unreachable!(), + } +} + +fn generate_length_percentage_auto(dimen: &json::object::Object) -> TokenStream { + let unit = dimen.get("unit").unwrap(); + let value = || dimen.get("value").unwrap().as_f32().unwrap(); + + match unit { + json::JsonValue::Short(ref unit) => match unit.as_ref() { + "auto" => quote!(taffy::style::LengthPercentageAuto::Auto), + "points" => { + let value = value(); + quote!(taffy::style::LengthPercentageAuto::Points(#value)) + } + "percent" => { + let value = value(); + quote!(taffy::style::LengthPercentageAuto::Percent(#value)) + } + _ => unreachable!(), + }, + _ => unreachable!(), + } +} + fn generate_dimension(dimen: &json::object::Object) -> TokenStream { let unit = dimen.get("unit").unwrap(); let value = || dimen.get("value").unwrap().as_f32().unwrap(); @@ -552,18 +613,6 @@ fn generate_dimension(dimen: &json::object::Object) -> TokenStream { } } -fn generate_edges(dimen: &json::object::Object) -> TokenStream { - dim_quoted!(dimen, left); - dim_quoted!(dimen, right); - dim_quoted!(dimen, top); - dim_quoted!(dimen, bottom); - - quote!(taffy::geometry::Rect { - #left #right #top #bottom - ..Default::default() - }) -} - fn generate_grid_auto_flow(auto_flow: &json::object::Object) -> TokenStream { let direction = auto_flow.get("direction").unwrap().as_str().unwrap(); let algorithm = auto_flow.get("algorithm").unwrap().as_str().unwrap(); diff --git a/src/compute/flexbox.rs b/src/compute/flexbox.rs index a418fb444..f6b0b35c6 100644 --- a/src/compute/flexbox.rs +++ b/src/compute/flexbox.rs @@ -8,8 +8,10 @@ use crate::geometry::{Point, Rect, Size}; use crate::layout::{AvailableSpace, Layout, RunMode, SizingMode}; use crate::math::MaybeMath; use crate::node::Node; -use crate::resolve::{MaybeResolve, ResolveOrDefault}; -use crate::style::{AlignContent, AlignSelf, Dimension, Display, FlexWrap, JustifyContent, PositionType}; +use crate::resolve::{MaybeResolve, ResolveOrZero}; +use crate::style::{ + AlignContent, AlignSelf, Dimension, Display, FlexWrap, JustifyContent, LengthPercentageAuto, PositionType, +}; use crate::style::{FlexDirection, Style}; use crate::sys::Vec; use crate::tree::LayoutTree; @@ -352,9 +354,9 @@ fn compute_constants(style: &Style, node_size: Size>, parent_size: S let is_column = dir.is_column(); let is_wrap_reverse = style.flex_wrap == FlexWrap::WrapReverse; - let margin = style.margin.resolve_or_default(parent_size.width.into_option()); - let padding = style.padding.resolve_or_default(parent_size.width.into_option()); - let border = style.border.resolve_or_default(parent_size.width.into_option()); + let margin = style.margin.resolve_or_zero(parent_size.width.into_option()); + let padding = style.padding.resolve_or_zero(parent_size.width.into_option()); + let border = style.border.resolve_or_zero(parent_size.width.into_option()); let padding_border = Rect { left: padding.left + border.left, @@ -367,10 +369,10 @@ fn compute_constants(style: &Style, node_size: Size>, parent_size: S width: node_size.width.maybe_sub(padding_border.horizontal_axis_sum()), height: node_size.height.maybe_sub(padding_border.vertical_axis_sum()), }; - let gap = style.gap.resolve_or_default(node_inner_size.or(Size { width: Some(0.0), height: Some(0.0) })); + let gap = style.gap.resolve_or_zero(node_inner_size.or(Size::zero())); - let container_size = Size::ZERO; - let inner_container_size = Size::ZERO; + let container_size = Size::zero(); + let inner_container_size = Size::zero(); AlgoConstants { dir, @@ -405,18 +407,18 @@ fn generate_anonymous_flex_items(tree: &impl LayoutTree, node: Node, constants: max_size: child_style.max_size.maybe_resolve(constants.node_inner_size), position: child_style.position.zip_size(constants.node_inner_size, |p, s| p.maybe_resolve(s)), - margin: child_style.margin.resolve_or_default(constants.node_inner_size.width), - padding: child_style.padding.resolve_or_default(constants.node_inner_size.width), - border: child_style.border.resolve_or_default(constants.node_inner_size.width), + margin: child_style.margin.resolve_or_zero(constants.node_inner_size.width), + padding: child_style.padding.resolve_or_zero(constants.node_inner_size.width), + border: child_style.border.resolve_or_zero(constants.node_inner_size.width), flex_basis: 0.0, inner_flex_basis: 0.0, violation: 0.0, frozen: false, - hypothetical_inner_size: Size::ZERO, - hypothetical_outer_size: Size::ZERO, - target_size: Size::ZERO, - outer_target_size: Size::ZERO, + hypothetical_inner_size: Size::zero(), + hypothetical_outer_size: Size::zero(), + target_size: Size::zero(), + outer_target_size: Size::zero(), baseline: 0.0, @@ -1020,7 +1022,7 @@ fn calculate_children_base_lines( &Layout { order: tree.children(node).position(|n| *n == child.node).unwrap() as u32, size: preliminary_size, - location: Point::ZERO, + location: Point::zero(), }, ); } @@ -1080,8 +1082,8 @@ fn calculate_cross_size( .map(|child| { let child_style = tree.style(child.node); if child_style.align_self(tree.style(node)) == AlignSelf::Baseline - && child_style.cross_margin_start(constants.dir) != Dimension::Auto - && child_style.cross_margin_end(constants.dir) != Dimension::Auto + && child_style.cross_margin_start(constants.dir) != LengthPercentageAuto::Auto + && child_style.cross_margin_end(constants.dir) != LengthPercentageAuto::Auto && child_style.cross_size(constants.dir) == Dimension::Auto { max_baseline - child.baseline + child.hypothetical_outer_size.cross(constants.dir) @@ -1150,8 +1152,8 @@ fn determine_used_cross_size( child.target_size.set_cross( constants.dir, if child_style.align_self(tree.style(node)) == AlignSelf::Stretch - && child_style.cross_margin_start(constants.dir) != Dimension::Auto - && child_style.cross_margin_end(constants.dir) != Dimension::Auto + && child_style.cross_margin_start(constants.dir) != LengthPercentageAuto::Auto + && child_style.cross_margin_end(constants.dir) != LengthPercentageAuto::Auto && child_style.cross_size(constants.dir) == Dimension::Auto { (line_cross_size - child.margin.cross_axis_sum(constants.dir)) @@ -1195,10 +1197,10 @@ fn distribute_remaining_free_space( for child in line.items.iter_mut() { let child_style = tree.style(child.node); - if child_style.main_margin_start(constants.dir) == Dimension::Auto { + if child_style.main_margin_start(constants.dir) == LengthPercentageAuto::Auto { num_auto_margins += 1; } - if child_style.main_margin_end(constants.dir) == Dimension::Auto { + if child_style.main_margin_end(constants.dir) == LengthPercentageAuto::Auto { num_auto_margins += 1; } } @@ -1208,14 +1210,14 @@ fn distribute_remaining_free_space( for child in line.items.iter_mut() { let child_style = tree.style(child.node); - if child_style.main_margin_start(constants.dir) == Dimension::Auto { + if child_style.main_margin_start(constants.dir) == LengthPercentageAuto::Auto { if constants.is_row { child.margin.left = margin; } else { child.margin.top = margin; } } - if child_style.main_margin_end(constants.dir) == Dimension::Auto { + if child_style.main_margin_end(constants.dir) == LengthPercentageAuto::Auto { if constants.is_row { child.margin.right = margin; } else { @@ -1321,8 +1323,8 @@ fn resolve_cross_axis_auto_margins( let free_space = line_cross_size - child.outer_target_size.cross(constants.dir); let child_style = tree.style(child.node); - if child_style.cross_margin_start(constants.dir) == Dimension::Auto - && child_style.cross_margin_end(constants.dir) == Dimension::Auto + if child_style.cross_margin_start(constants.dir) == LengthPercentageAuto::Auto + && child_style.cross_margin_end(constants.dir) == LengthPercentageAuto::Auto { if constants.is_row { child.margin.top = free_space / 2.0; @@ -1331,13 +1333,13 @@ fn resolve_cross_axis_auto_margins( child.margin.left = free_space / 2.0; child.margin.right = free_space / 2.0; } - } else if child_style.cross_margin_start(constants.dir) == Dimension::Auto { + } else if child_style.cross_margin_start(constants.dir) == LengthPercentageAuto::Auto { if constants.is_row { child.margin.top = free_space; } else { child.margin.left = free_space; } - } else if child_style.cross_margin_end(constants.dir) == Dimension::Auto { + } else if child_style.cross_margin_end(constants.dir) == LengthPercentageAuto::Auto { if constants.is_row { child.margin.bottom = free_space; } else { @@ -1851,7 +1853,7 @@ mod tests { use crate::{ math::MaybeMath, prelude::{Rect, Size}, - resolve::ResolveOrDefault, + resolve::ResolveOrZero, style::{FlexWrap, Style}, Taffy, }; @@ -1875,13 +1877,13 @@ mod tests { assert!(constants.is_column == style.flex_direction.is_column()); assert!(constants.is_wrap_reverse == (style.flex_wrap == FlexWrap::WrapReverse)); - let margin = style.margin.resolve_or_default(parent_size.as_options()); + let margin = style.margin.resolve_or_zero(parent_size.as_options()); assert_eq!(constants.margin, margin); - let border = style.border.resolve_or_default(parent_size.as_options()); + let border = style.border.resolve_or_zero(parent_size.as_options()); assert_eq!(constants.border, border); - let padding = style.padding.resolve_or_default(parent_size.as_options()); + let padding = style.padding.resolve_or_zero(parent_size.as_options()); // TODO: Replace with something less hardcoded? let padding_border = Rect { @@ -1900,8 +1902,8 @@ mod tests { }; assert_eq!(constants.node_inner_size, inner_size); - assert_eq!(constants.container_size, Size::ZERO); - assert_eq!(constants.inner_container_size, Size::ZERO); + assert_eq!(constants.container_size, Size::zero()); + assert_eq!(constants.inner_container_size, Size::zero()); } #[test] @@ -1933,8 +1935,8 @@ mod tests { // all layouts should resolve to ZERO due to the root's DISPLAY::NONE for (node, _) in &taffy.nodes { if let Ok(layout) = taffy.layout(node) { - assert_eq!(layout.size, Size::ZERO); - assert_eq!(layout.location, Point::ZERO); + assert_eq!(layout.size, Size::zero()); + assert_eq!(layout.location, Point::zero()); } } } diff --git a/src/compute/leaf.rs b/src/compute/leaf.rs index 6dd1865dd..b8ab4d2d5 100644 --- a/src/compute/leaf.rs +++ b/src/compute/leaf.rs @@ -4,7 +4,7 @@ use crate::geometry::Size; use crate::layout::{AvailableSpace, RunMode, SizingMode}; use crate::math::MaybeMath; use crate::node::Node; -use crate::resolve::{MaybeResolve, ResolveOrDefault}; +use crate::resolve::{MaybeResolve, ResolveOrZero}; use crate::tree::LayoutTree; #[cfg(feature = "debug")] @@ -66,8 +66,8 @@ pub(crate) fn compute( return node_size.unwrap_or(measured_size).maybe_clamp(node_min_size, node_max_size); } - let padding = style.padding.resolve_or_default(available_space.width.into_option()); - let border = style.border.resolve_or_default(available_space.width.into_option()); + let padding = style.padding.resolve_or_zero(available_space.width.into_option()); + let border = style.border.resolve_or_zero(available_space.width.into_option()); Size { width: node_size diff --git a/src/geometry.rs b/src/geometry.rs index 7f871b926..ba4762c08 100644 --- a/src/geometry.rs +++ b/src/geometry.rs @@ -28,6 +28,17 @@ pub struct Rect { pub bottom: T, } +impl Default for Rect { + fn default() -> Self { + Rect { + left: Default::default(), + right: Default::default(), + top: Default::default(), + bottom: Default::default(), + } + } +} + impl Rect { /// Applies the function `f` to all four sides of the rect /// @@ -160,6 +171,12 @@ pub struct Size { pub height: T, } +impl Default for Size { + fn default() -> Self { + Size { width: Default::default(), height: Default::default() } + } +} + impl Size { /// Applies the function `f` to both the width and height /// @@ -279,12 +296,6 @@ impl Size { pub const fn from_percent(width: f32, height: f32) -> Self { Size { width: Dimension::Percent(width), height: Dimension::Percent(height) } } - - /// Generates a [`Size`] using [`Dimension::Auto`] in both width and height - pub const AUTO: Size = Self { width: Dimension::Auto, height: Dimension::Auto }; - - /// Generates a [`Size`] using [`Dimension::Undefined`] in both width and height - pub const UNDEFINED: Size = Self { width: Dimension::Undefined, height: Dimension::Undefined }; } /// A 2-dimensional coordinate. diff --git a/src/layout.rs b/src/layout.rs index 6d95995ce..020b25af9 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -126,7 +126,7 @@ impl Layout { /// This means it should be rendered below all other [`Layout`]s. #[must_use] pub const fn new() -> Self { - Self { order: 0, size: Size::ZERO, location: Point::ZERO } + Self { order: 0, size: Size::zero(), location: Point::ZERO } } /// Creates a new zero-[`Layout`] with the supplied `order` value. @@ -135,7 +135,7 @@ impl Layout { /// The Zero-layout has size and location set to ZERO. #[must_use] pub const fn with_order(order: u32) -> Self { - Self { order, size: Size::ZERO, location: Point::ZERO } + Self { order, size: Size::zero(), location: Point::ZERO } } } diff --git a/src/lib.rs b/src/lib.rs index 80134e8d7..a04c80a38 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,6 +27,7 @@ pub mod math; pub mod node; pub mod prelude; pub mod style; +pub mod style_helpers; pub mod tree; #[cfg(feature = "random")] diff --git a/src/prelude.rs b/src/prelude.rs index cf4297be7..dd6e8dc0c 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -6,8 +6,9 @@ pub use crate::{ layout::{AvailableSpace, Layout}, node::{Node, Taffy}, style::{ - AlignContent, AlignItems, AlignSelf, Dimension, Display, FlexDirection, FlexWrap, JustifyContent, PositionType, - Style, + AlignContent, AlignItems, AlignSelf, Dimension, Display, FlexDirection, FlexWrap, JustifyContent, + LengthPercentage, LengthPercentageAuto, PositionType, Style, }, + style_helpers::{auto, points, zero}, tree::LayoutTree, }; diff --git a/src/randomizable.rs b/src/randomizable.rs index f766abfe4..23a98453e 100644 --- a/src/randomizable.rs +++ b/src/randomizable.rs @@ -25,8 +25,6 @@ impl Randomizeable for Dimension { if switch < 0.2 { Dimension::Auto - } else if switch < 0.4 { - Dimension::Undefined } else if switch < 0.8 { Dimension::Points(rng.gen_range(0.0..500.0)) } else { diff --git a/src/resolve.rs b/src/resolve.rs index 08f85c5d7..0705fa8c2 100644 --- a/src/resolve.rs +++ b/src/resolve.rs @@ -1,25 +1,49 @@ //! Helper trait to calculate dimensions during layout resolution -use crate::prelude::{Dimension, Rect, Size}; +use crate::prelude::{Dimension, LengthPercentage, LengthPercentageAuto, Rect, Size}; +use crate::style_helpers::TaffyZero; /// Trait to encapsulate behaviour where we need to resolve from a /// potentially context-dependent size or dimension into /// a context-independent size or dimension. /// -/// Will return a default value if it unable to resolve. -pub(crate) trait ResolveOrDefault { - /// Resolve a dimension that might be dependent on a context, with a default fallback value - fn resolve_or_default(self, context: TContext) -> TOutput; +/// Will return a `None` if it unable to resolve. +pub(crate) trait MaybeResolve { + /// Resolve a dimension that might be dependent on a context, with `None` as fallback value + fn maybe_resolve(self, context: In) -> Out; } /// Trait to encapsulate behaviour where we need to resolve from a /// potentially context-dependent size or dimension into /// a context-independent size or dimension. /// -/// Will return a `None` if it unable to resolve. -pub(crate) trait MaybeResolve { - /// Resolve a dimension that might be dependent on a context, with `None` as fallback value - fn maybe_resolve(self, context: In) -> Out; +/// Will return a default value if it unable to resolve. +pub(crate) trait ResolveOrZero { + /// Resolve a dimension that might be dependent on a context, with a default fallback value + fn resolve_or_zero(self, context: TContext) -> TOutput; +} + +impl MaybeResolve, Option> for LengthPercentage { + /// Converts the given [`LengthPercentage`] into a concrete value of points + /// Can return `None` + fn maybe_resolve(self, context: Option) -> Option { + match self { + LengthPercentage::Points(points) => Some(points), + LengthPercentage::Percent(percent) => context.map(|dim| dim * percent), + } + } +} + +impl MaybeResolve, Option> for LengthPercentageAuto { + /// Converts the given [`LengthPercentageAuto`] into a concrete value of points + /// Can return `None` + fn maybe_resolve(self, context: Option) -> Option { + match self { + LengthPercentageAuto::Points(points) => Some(points), + LengthPercentageAuto::Percent(percent) => context.map(|dim| dim * percent), + LengthPercentageAuto::Auto => None, + } + } } impl MaybeResolve, Option> for Dimension { @@ -29,24 +53,19 @@ impl MaybeResolve, Option> for Dimension { fn maybe_resolve(self, context: Option) -> Option { match self { Dimension::Points(points) => Some(points), - // parent_dim * percent Dimension::Percent(percent) => context.map(|dim| dim * percent), - _ => None, + Dimension::Auto => None, } } } -impl MaybeResolve> for Dimension { - /// Converts the given [`Dimension`] into a concrete value of points - /// +// Generic implementation of MaybeResolve for f32 context where MaybeResolve is implemented +// for Option context +impl, Option>> MaybeResolve> for T { + /// Converts the given MaybeResolve value into a concrete value of points /// Can return `None` fn maybe_resolve(self, context: f32) -> Option { - match self { - Dimension::Points(points) => Some(points), - // parent_dim * percent - Dimension::Percent(percent) => Some(context * percent), - _ => None, - } + self.maybe_resolve(Some(context)) } } @@ -58,40 +77,57 @@ impl> MaybeResolve, Size> for Si } } -impl ResolveOrDefault, f32> for Dimension { +impl ResolveOrZero, f32> for LengthPercentage { /// Will return a default value of result is evaluated to `None` - fn resolve_or_default(self, context: Option) -> f32 { + fn resolve_or_zero(self, context: Option) -> f32 { self.maybe_resolve(context).unwrap_or(0.0) } } -impl ResolveOrDefault>, Size> for Size { - fn resolve_or_default(self, context: Size>) -> Size { - Size { - width: self.width.resolve_or_default(context.width), - height: self.height.resolve_or_default(context.height), - } +impl ResolveOrZero, f32> for LengthPercentageAuto { + /// Will return a default value of result is evaluated to `None` + fn resolve_or_zero(self, context: Option) -> f32 { + self.maybe_resolve(context).unwrap_or(0.0) } } -impl ResolveOrDefault>, Rect> for Rect { - fn resolve_or_default(self, context: Size>) -> Rect { +impl ResolveOrZero, f32> for Dimension { + /// Will return a default value of result is evaluated to `None` + fn resolve_or_zero(self, context: Option) -> f32 { + self.maybe_resolve(context).unwrap_or(0.0) + } +} + +// Generic ResolveOrZero for Size +impl> ResolveOrZero, Size> for Size { + /// Converts any `parent`-relative values for size into an absolute size + fn resolve_or_zero(self, context: Size) -> Size { + Size { width: self.width.resolve_or_zero(context.width), height: self.height.resolve_or_zero(context.height) } + } +} + +// Generic ResolveOrZero for resolving Rect against Size +impl> ResolveOrZero, Rect> for Rect { + /// Converts any `parent`-relative values for Rect into an absolute Rect + fn resolve_or_zero(self, context: Size) -> Rect { Rect { - left: self.left.resolve_or_default(context.width), - right: self.right.resolve_or_default(context.width), - top: self.top.resolve_or_default(context.height), - bottom: self.bottom.resolve_or_default(context.height), + left: self.left.resolve_or_zero(context.width), + right: self.right.resolve_or_zero(context.width), + top: self.top.resolve_or_zero(context.height), + bottom: self.bottom.resolve_or_zero(context.height), } } } -impl ResolveOrDefault, Rect> for Rect { - fn resolve_or_default(self, context: Option) -> Rect { +// Generic ResolveOrZero for resolving Rect against Option +impl, Out>> ResolveOrZero, Rect> for Rect { + /// Converts any `parent`-relative values for Rect into an absolute Rect + fn resolve_or_zero(self, context: Option) -> Rect { Rect { - left: self.left.resolve_or_default(context), - right: self.right.resolve_or_default(context), - top: self.top.resolve_or_default(context), - bottom: self.bottom.resolve_or_default(context), + left: self.left.resolve_or_zero(context), + right: self.right.resolve_or_zero(context), + top: self.top.resolve_or_zero(context), + bottom: self.bottom.resolve_or_zero(context), } } } @@ -104,18 +140,6 @@ mod tests { use crate::style::Dimension; use rstest::rstest; - /// `Dimension::Undefined` should always return `None` - /// - /// The parent / context should not affect the outcome. - #[rstest] - #[case(Dimension::Undefined, None, None)] - #[case(Dimension::Undefined, Some(5.0), None)] - #[case(Dimension::Undefined, Some(-5.0), None)] - #[case(Dimension::Undefined, Some(0.), None)] - fn resolve_undefined(#[case] input: Dimension, #[case] context: Option, #[case] expected: Option) { - assert_eq!(input.maybe_resolve(context), expected); - } - /// `Dimension::Auto` should always return `None` /// /// The parent / context should not affect the outcome. @@ -160,30 +184,14 @@ mod tests { use crate::{prelude::Size, resolve::MaybeResolve, style::Dimension}; use rstest::rstest; - /// Size should always return Size - /// - /// The parent / context should not affect the outcome. - #[rstest] - #[case(Size::UNDEFINED, Size::NONE, Size::NONE)] - #[case(Size::UNDEFINED, Size::new(5.0, 5.0), Size::NONE)] - #[case(Size::UNDEFINED, Size::new(-5.0, -5.0), Size::NONE)] - #[case(Size::UNDEFINED, Size::new(0.0, 0.0), Size::NONE)] - fn maybe_resolve_undefined( - #[case] input: Size, - #[case] context: Size>, - #[case] expected: Size>, - ) { - assert_eq!(input.maybe_resolve(context), expected); - } - /// Size should always return Size /// /// The parent / context should not affect the outcome. #[rstest] - #[case(Size::AUTO, Size::NONE, Size::NONE)] - #[case(Size::AUTO, Size::new(5.0, 5.0), Size::NONE)] - #[case(Size::AUTO, Size::new(-5.0, -5.0), Size::NONE)] - #[case(Size::AUTO, Size::new(0.0, 0.0), Size::NONE)] + #[case(Size::auto(), Size::NONE, Size::NONE)] + #[case(Size::auto(), Size::new(5.0, 5.0), Size::NONE)] + #[case(Size::auto(), Size::new(-5.0, -5.0), Size::NONE)] + #[case(Size::auto(), Size::new(0.0, 0.0), Size::NONE)] fn maybe_resolve_auto( #[case] input: Size, #[case] context: Size>, @@ -228,75 +236,54 @@ mod tests { } } - mod resolve_or_default_dimension_to_option_f32 { - use crate::resolve::ResolveOrDefault; + mod resolve_or_zero_dimension_to_option_f32 { + use crate::resolve::ResolveOrZero; use crate::style::Dimension; use rstest::rstest; - #[rstest] - #[case(Dimension::Undefined, None, 0.0)] - #[case(Dimension::Undefined, Some(5.0), 0.0)] - #[case(Dimension::Undefined, Some(-5.0), 0.0)] - #[case(Dimension::Undefined, Some(0.0), 0.0)] - fn resolve_or_default_undefined(#[case] input: Dimension, #[case] context: Option, #[case] expected: f32) { - assert_eq!(input.resolve_or_default(context), expected); - } #[rstest] #[case(Dimension::Auto, None, 0.0)] #[case(Dimension::Auto, Some(5.0), 0.0)] #[case(Dimension::Auto, Some(-5.0), 0.0)] #[case(Dimension::Auto, Some(0.0), 0.0)] - fn resolve_or_default_auto(#[case] input: Dimension, #[case] context: Option, #[case] expected: f32) { - assert_eq!(input.resolve_or_default(context), expected); + fn resolve_or_zero_auto(#[case] input: Dimension, #[case] context: Option, #[case] expected: f32) { + assert_eq!(input.resolve_or_zero(context), expected); } #[rstest] #[case(Dimension::Points(5.0), None, 5.0)] #[case(Dimension::Points(5.0), Some(5.0), 5.0)] #[case(Dimension::Points(5.0), Some(-5.0), 5.0)] #[case(Dimension::Points(5.0), Some(0.0), 5.0)] - fn resolve_or_default_points(#[case] input: Dimension, #[case] context: Option, #[case] expected: f32) { - assert_eq!(input.resolve_or_default(context), expected); + fn resolve_or_zero_points(#[case] input: Dimension, #[case] context: Option, #[case] expected: f32) { + assert_eq!(input.resolve_or_zero(context), expected); } #[rstest] #[case(Dimension::Percent(5.0), None, 0.0)] #[case(Dimension::Percent(5.0), Some(5.0), 25.0)] #[case(Dimension::Percent(5.0), Some(-5.0), -25.0)] #[case(Dimension::Percent(5.0), Some(0.0), 0.0)] - fn resolve_or_default_percent(#[case] input: Dimension, #[case] context: Option, #[case] expected: f32) { - assert_eq!(input.resolve_or_default(context), expected); + fn resolve_or_zero_percent(#[case] input: Dimension, #[case] context: Option, #[case] expected: f32) { + assert_eq!(input.resolve_or_zero(context), expected); } } - mod resolve_or_default_rect_dimension_to_rect { + mod resolve_or_zero_rect_dimension_to_rect { use crate::geometry::{Rect, Size}; - use crate::resolve::ResolveOrDefault; + use crate::resolve::ResolveOrZero; use crate::style::Dimension; use rstest::rstest; #[rstest] - #[case(Rect::UNDEFINED, Size::NONE, Rect::ZERO)] - #[case(Rect::UNDEFINED, Size::new(5.0, 5.0), Rect::ZERO)] - #[case(Rect::UNDEFINED, Size::new(-5.0, -5.0), Rect::ZERO)] - #[case(Rect::UNDEFINED, Size::new(0.0, 0.0), Rect::ZERO)] - fn resolve_or_default_undefined( - #[case] input: Rect, - #[case] context: Size>, - #[case] expected: Rect, - ) { - assert_eq!(input.resolve_or_default(context), expected); - } - - #[rstest] - #[case(Rect::AUTO, Size::NONE, Rect::ZERO)] - #[case(Rect::AUTO, Size::new(5.0, 5.0), Rect::ZERO)] - #[case(Rect::AUTO, Size::new(-5.0, -5.0), Rect::ZERO)] - #[case(Rect::AUTO, Size::new(0.0, 0.0), Rect::ZERO)] - fn resolve_or_default_auto( + #[case(Rect::auto(), Size::NONE, Rect::zero())] + #[case(Rect::auto(), Size::new(5.0, 5.0), Rect::zero())] + #[case(Rect::auto(), Size::new(-5.0, -5.0), Rect::zero())] + #[case(Rect::auto(), Size::new(0.0, 0.0), Rect::zero())] + fn resolve_or_zero_auto( #[case] input: Rect, #[case] context: Size>, #[case] expected: Rect, ) { - assert_eq!(input.resolve_or_default(context), expected); + assert_eq!(input.resolve_or_zero(context), expected); } #[rstest] @@ -304,58 +291,45 @@ mod tests { #[case(Rect::from_points(5.0, 5.0, 5.0, 5.0), Size::new(5.0, 5.0), Rect::new(5.0, 5.0, 5.0, 5.0))] #[case(Rect::from_points(5.0, 5.0, 5.0, 5.0), Size::new(-5.0, -5.0), Rect::new(5.0, 5.0, 5.0, 5.0))] #[case(Rect::from_points(5.0, 5.0, 5.0, 5.0), Size::new(0.0, 0.0), Rect::new(5.0, 5.0, 5.0, 5.0))] - fn resolve_or_default_points( + fn resolve_or_zero_points( #[case] input: Rect, #[case] context: Size>, #[case] expected: Rect, ) { - assert_eq!(input.resolve_or_default(context), expected); + assert_eq!(input.resolve_or_zero(context), expected); } #[rstest] - #[case(Rect::from_percent(5.0, 5.0, 5.0, 5.0), Size::NONE, Rect::ZERO)] + #[case(Rect::from_percent(5.0, 5.0, 5.0, 5.0), Size::NONE, Rect::zero())] #[case(Rect::from_percent(5.0, 5.0, 5.0, 5.0), Size::new(5.0, 5.0), Rect::new(25.0, 25.0, 25.0, 25.0))] #[case(Rect::from_percent(5.0, 5.0, 5.0, 5.0), Size::new(-5.0, -5.0), Rect::new(-25.0, -25.0, -25.0, -25.0))] - #[case(Rect::from_percent(5.0, 5.0, 5.0, 5.0), Size::new(0.0, 0.0), Rect::ZERO)] - fn resolve_or_default_percent( + #[case(Rect::from_percent(5.0, 5.0, 5.0, 5.0), Size::new(0.0, 0.0), Rect::zero())] + fn resolve_or_zero_percent( #[case] input: Rect, #[case] context: Size>, #[case] expected: Rect, ) { - assert_eq!(input.resolve_or_default(context), expected); + assert_eq!(input.resolve_or_zero(context), expected); } } - mod resolve_or_default_rect_dimension_to_rect_f32_via_option { + mod resolve_or_zero_rect_dimension_to_rect_f32_via_option { use crate::geometry::Rect; - use crate::resolve::ResolveOrDefault; + use crate::resolve::ResolveOrZero; use crate::style::Dimension; use rstest::rstest; #[rstest] - #[case(Rect::UNDEFINED, None, Rect::ZERO)] - #[case(Rect::UNDEFINED, Some(5.0), Rect::ZERO)] - #[case(Rect::UNDEFINED, Some(-5.0), Rect::ZERO)] - #[case(Rect::UNDEFINED, Some(0.0), Rect::ZERO)] - fn resolve_or_default_undefined( - #[case] input: Rect, - #[case] context: Option, - #[case] expected: Rect, - ) { - assert_eq!(input.resolve_or_default(context), expected); - } - - #[rstest] - #[case(Rect::AUTO, None, Rect::ZERO)] - #[case(Rect::AUTO, Some(5.0), Rect::ZERO)] - #[case(Rect::AUTO, Some(-5.0), Rect::ZERO)] - #[case(Rect::AUTO, Some(0.0), Rect::ZERO)] - fn resolve_or_default_auto( + #[case(Rect::auto(), None, Rect::zero())] + #[case(Rect::auto(), Some(5.0), Rect::zero())] + #[case(Rect::auto(), Some(-5.0), Rect::zero())] + #[case(Rect::auto(), Some(0.0), Rect::zero())] + fn resolve_or_zero_auto( #[case] input: Rect, #[case] context: Option, #[case] expected: Rect, ) { - assert_eq!(input.resolve_or_default(context), expected); + assert_eq!(input.resolve_or_zero(context), expected); } #[rstest] @@ -363,25 +337,25 @@ mod tests { #[case(Rect::from_points(5.0, 5.0, 5.0, 5.0), Some(5.0), Rect::new(5.0, 5.0, 5.0, 5.0))] #[case(Rect::from_points(5.0, 5.0, 5.0, 5.0), Some(-5.0), Rect::new(5.0, 5.0, 5.0, 5.0))] #[case(Rect::from_points(5.0, 5.0, 5.0, 5.0), Some(0.0), Rect::new(5.0, 5.0, 5.0, 5.0))] - fn resolve_or_default_points( + fn resolve_or_zero_points( #[case] input: Rect, #[case] context: Option, #[case] expected: Rect, ) { - assert_eq!(input.resolve_or_default(context), expected); + assert_eq!(input.resolve_or_zero(context), expected); } #[rstest] - #[case(Rect::from_percent(5.0, 5.0, 5.0, 5.0), None, Rect::ZERO)] + #[case(Rect::from_percent(5.0, 5.0, 5.0, 5.0), None, Rect::zero())] #[case(Rect::from_percent(5.0, 5.0, 5.0, 5.0), Some(5.0), Rect::new(25.0, 25.0, 25.0, 25.0))] #[case(Rect::from_percent(5.0, 5.0, 5.0, 5.0), Some(-5.0), Rect::new(-25.0, -25.0, -25.0, -25.0))] - #[case(Rect::from_percent(5.0, 5.0, 5.0, 5.0), Some(0.0), Rect::ZERO)] - fn resolve_or_default_percent( + #[case(Rect::from_percent(5.0, 5.0, 5.0, 5.0), Some(0.0), Rect::zero())] + fn resolve_or_zero_percent( #[case] input: Rect, #[case] context: Option, #[case] expected: Rect, ) { - assert_eq!(input.resolve_or_default(context), expected); + assert_eq!(input.resolve_or_zero(context), expected); } } } diff --git a/src/style.rs b/src/style.rs index 7b0b13491..871f4c5c7 100644 --- a/src/style.rs +++ b/src/style.rs @@ -252,26 +252,44 @@ impl Default for FlexWrap { /// A unit of linear measurement /// /// This is commonly combined with [`Rect`], [`Point`](crate::geometry::Point) and [`Size`]. -/// The default value is [`Dimension::Undefined`]. #[derive(Copy, Clone, PartialEq, Debug)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] -pub enum Dimension { - /// The dimension is not given - Undefined, - /// The dimension should be automatically computed - Auto, - /// The dimension is stored in [points](https://en.wikipedia.org/wiki/Point_(typography)) - /// - /// Each point is about 0.353 mm in size. +pub enum LengthPercentage { + /// Points are abstract absolute units. Users of Taffy may define what they correspond + /// to in their application (pixels, logical pixels, mm, etc) as they see fit. Points(f32), /// The dimension is stored in percentage relative to the parent item. Percent(f32), } -impl Default for Dimension { - fn default() -> Self { - Self::Undefined - } +/// A unit of linear measurement +/// +/// This is commonly combined with [`Rect`], [`Point`](crate::geometry::Point) and [`Size`]. +#[derive(Copy, Clone, PartialEq, Debug)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +pub enum LengthPercentageAuto { + /// Points are abstract absolute units. Users of Taffy may define what they correspond + /// to in their application (pixels, logical pixels, mm, etc) as they see fit. + Points(f32), + /// The dimension is stored in percentage relative to the parent item. + Percent(f32), + /// The dimension should be automatically computed + Auto, +} + +/// A unit of linear measurement +/// +/// This is commonly combined with [`Rect`], [`Point`](crate::geometry::Point) and [`Size`]. +#[derive(Copy, Clone, PartialEq, Debug)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +pub enum Dimension { + /// Points are abstract absolute units. Users of Taffy may define what they correspond + /// to in their application (pixels, logical pixels, mm, etc) as they see fit. + Points(f32), + /// The dimension is stored in percentage relative to the parent item. + Percent(f32), + /// The dimension should be automatically computed + Auto, } impl Dimension { @@ -281,17 +299,6 @@ impl Dimension { } } -impl Default for Rect { - fn default() -> Self { - Self { - left: Default::default(), - right: Default::default(), - top: Default::default(), - bottom: Default::default(), - } - } -} - impl Rect { /// Generates a [`Rect`] using [`Dimension::Points`] values for `start` and `top` #[must_use] @@ -317,14 +324,6 @@ impl Rect { Rect { right: Dimension::Percent(end), bottom: Dimension::Percent(bottom), ..Rect::AUTO } } - /// Generates a [`Rect`] using [`Dimension::Undefined`] for all values - pub const UNDEFINED: Rect = Self { - left: Dimension::Undefined, - right: Dimension::Undefined, - top: Dimension::Undefined, - bottom: Dimension::Undefined, - }; - /// Generates a [`Rect`] using [`Dimension::Auto`] for all values pub const AUTO: Rect = Self { left: Dimension::Auto, right: Dimension::Auto, top: Dimension::Auto, bottom: Dimension::Auto }; @@ -352,12 +351,6 @@ impl Rect { } } -impl Default for Size { - fn default() -> Self { - Self { width: Dimension::Auto, height: Dimension::Auto } - } -} - /// The flexbox layout information for a single [`Node`](crate::node::Node). /// /// The most important idea in flexbox is the notion of a "main" and "cross" axis, which are always perpendicular to each other. @@ -393,16 +386,16 @@ pub struct Style { /// How should items be aligned relative to the main axis? pub justify_content: JustifyContent, /// How should the position of this element be tweaked relative to the layout defined? - pub position: Rect, + pub position: Rect, /// How large should the margin be on each side? - pub margin: Rect, + pub margin: Rect, /// How large should the padding be on each side? - pub padding: Rect, + pub padding: Rect, /// How large should the border be on each side? - pub border: Rect, + pub border: Rect, // Gap /// How large should the gaps between items in a grid or flex container be? - pub gap: Size, + pub gap: Size, /// The relative rate at which this item grows when it is expanding to fill space /// /// 0.0 is the default value, and this value must not be negative. @@ -437,17 +430,17 @@ impl Style { align_self: AlignSelf::Auto, align_content: AlignContent::Stretch, justify_content: JustifyContent::FlexStart, - position: Rect::UNDEFINED, - margin: Rect::UNDEFINED, - padding: Rect::UNDEFINED, - border: Rect::UNDEFINED, - gap: Size::UNDEFINED, + position: Rect::auto(), + margin: Rect::zero(), + padding: Rect::zero(), + border: Rect::zero(), + gap: Size::zero(), flex_grow: 0.0, flex_shrink: 1.0, flex_basis: Dimension::Auto, - size: Size::AUTO, - min_size: Size::AUTO, - max_size: Size::AUTO, + size: Size::auto(), + min_size: Size::auto(), + max_size: Size::auto(), aspect_ratio: None, }; } @@ -478,7 +471,7 @@ impl Style { } /// If the `direction` is row-oriented, the margin start. Otherwise the margin top - pub(crate) fn main_margin_start(&self, direction: FlexDirection) -> Dimension { + pub(crate) fn main_margin_start(&self, direction: FlexDirection) -> LengthPercentageAuto { if direction.is_row() { self.margin.left } else { @@ -487,7 +480,7 @@ impl Style { } /// If the `direction` is row-oriented, the margin end. Otherwise the margin bottom - pub(crate) fn main_margin_end(&self, direction: FlexDirection) -> Dimension { + pub(crate) fn main_margin_end(&self, direction: FlexDirection) -> LengthPercentageAuto { if direction.is_row() { self.margin.right } else { @@ -523,7 +516,7 @@ impl Style { } /// If the `direction` is row-oriented, the margin top. Otherwise the margin start - pub(crate) fn cross_margin_start(&self, direction: FlexDirection) -> Dimension { + pub(crate) fn cross_margin_start(&self, direction: FlexDirection) -> LengthPercentageAuto { if direction.is_row() { self.margin.top } else { @@ -532,7 +525,7 @@ impl Style { } /// If the `direction` is row-oriented, the margin bottom. Otherwise the margin end - pub(crate) fn cross_margin_end(&self, direction: FlexDirection) -> Dimension { + pub(crate) fn cross_margin_end(&self, direction: FlexDirection) -> LengthPercentageAuto { if direction.is_row() { self.margin.bottom } else { @@ -563,7 +556,7 @@ impl Style { #[cfg(test)] mod tests { use super::Style; - use crate::geometry::Size; + use crate::geometry::{Rect, Size}; #[test] fn defaults_match() { @@ -576,17 +569,17 @@ mod tests { align_self: Default::default(), align_content: Default::default(), justify_content: Default::default(), - position: Default::default(), - margin: Default::default(), - padding: Default::default(), - border: Default::default(), - gap: Size::UNDEFINED, + position: Rect::auto(), + margin: Rect::zero(), + padding: Rect::zero(), + border: Rect::zero(), + gap: Size::zero(), flex_grow: 0.0, flex_shrink: 1.0, flex_basis: super::Dimension::Auto, - size: Default::default(), - min_size: Default::default(), - max_size: Default::default(), + size: Size::auto(), + min_size: Size::auto(), + max_size: Size::auto(), aspect_ratio: Default::default(), }; @@ -624,6 +617,7 @@ mod tests { mod test_flexbox_layout { use crate::style::*; + use crate::style_helpers::*; fn layout_from_align_items(align: AlignItems) -> Style { Style { align_items: align, ..Default::default() } @@ -649,16 +643,22 @@ mod tests { #[test] fn flexbox_layout_main_margin_start() { - let layout = Style { margin: Rect::top_from_points(2.0, 1.0), ..Default::default() }; - assert_eq!(layout.main_margin_start(FlexDirection::Row), Dimension::Points(2.0)); - assert_eq!(layout.main_margin_start(FlexDirection::Column), Dimension::Points(1.0)); + let layout = Style { + margin: Rect { top: points(1.0), bottom: auto(), left: points(2.0), right: auto() }, + ..Default::default() + }; + assert_eq!(layout.main_margin_start(FlexDirection::Row), points(2.0)); + assert_eq!(layout.main_margin_start(FlexDirection::Column), points(1.0)); } #[test] fn flexbox_layout_main_margin_end() { - let layout = Style { margin: Rect::bot_from_points(2.0, 1.0), ..Default::default() }; - assert_eq!(layout.main_margin_end(FlexDirection::Row), Dimension::Points(2.0)); - assert_eq!(layout.main_margin_end(FlexDirection::Column), Dimension::Points(1.0)); + let layout = Style { + margin: Rect { top: auto(), bottom: points(1.0), left: auto(), right: points(2.0) }, + ..Default::default() + }; + assert_eq!(layout.main_margin_end(FlexDirection::Row), points(2.0)); + assert_eq!(layout.main_margin_end(FlexDirection::Column), points(1.0)); } #[test] @@ -684,16 +684,22 @@ mod tests { #[test] fn flexbox_layout_cross_margin_start() { - let layout = Style { margin: Rect::top_from_points(2.0, 1.0), ..Default::default() }; - assert_eq!(layout.cross_margin_start(FlexDirection::Row), Dimension::Points(1.0)); - assert_eq!(layout.cross_margin_start(FlexDirection::Column), Dimension::Points(2.0)); + let layout = Style { + margin: Rect { top: points(1.0), bottom: auto(), left: points(2.0), right: auto() }, + ..Default::default() + }; + assert_eq!(layout.cross_margin_start(FlexDirection::Row), points(1.0)); + assert_eq!(layout.cross_margin_start(FlexDirection::Column), points(2.0)); } #[test] fn flexbox_layout_cross_margin_end() { - let layout = Style { margin: Rect::bot_from_points(2.0, 1.0), ..Default::default() }; - assert_eq!(layout.cross_margin_end(FlexDirection::Row), Dimension::Points(1.0)); - assert_eq!(layout.cross_margin_end(FlexDirection::Column), Dimension::Points(2.0)); + let layout = Style { + margin: Rect { top: auto(), bottom: points(1.0), left: auto(), right: points(2.0) }, + ..Default::default() + }; + assert_eq!(layout.cross_margin_end(FlexDirection::Row), points(1.0)); + assert_eq!(layout.cross_margin_end(FlexDirection::Column), points(2.0)); } #[test] diff --git a/src/style_helpers.rs b/src/style_helpers.rs new file mode 100644 index 000000000..51ca4347d --- /dev/null +++ b/src/style_helpers.rs @@ -0,0 +1,187 @@ +//! Helper functions which it make it easier to create instances of types in the `style` and `geometry` modules. + +use crate::geometry::{Point, Rect, Size}; +use crate::style::{Dimension, LengthPercentage, LengthPercentageAuto}; + +/// Returns the zero value for that type +pub const fn zero() -> T { + T::ZERO +} + +/// Trait to abstract over zero values +pub trait TaffyZero { + /// The zero value for type implementing TaffyZero + const ZERO: Self; +} +impl TaffyZero for f32 { + const ZERO: f32 = 0.0; +} +impl TaffyZero for LengthPercentage { + const ZERO: LengthPercentage = LengthPercentage::Points(0.0); +} +impl TaffyZero for LengthPercentageAuto { + const ZERO: LengthPercentageAuto = LengthPercentageAuto::Points(0.0); +} +impl TaffyZero for Dimension { + const ZERO: Dimension = Dimension::Points(0.0); +} +impl TaffyZero for Option { + const ZERO: Option = Some(T::ZERO); +} +impl TaffyZero for Point { + const ZERO: Point = Point { x: T::ZERO, y: T::ZERO }; +} +impl Point { + /// Returns a Point where both the x and y values are the zero value of the contained type + /// (e.g. 0.0, Some(0.0), or Dimension::Points(0.0)) + pub const fn zero() -> Self { + zero::() + } +} +impl TaffyZero for Size { + const ZERO: Size = Size { width: T::ZERO, height: T::ZERO }; +} +impl Size { + /// Returns a Size where both the width and height values are the zero value of the contained type + /// (e.g. 0.0, Some(0.0), or Dimension::Points(0.0)) + pub const fn zero() -> Self { + zero::() + } +} +impl TaffyZero for Rect { + const ZERO: Rect = Rect { left: T::ZERO, right: T::ZERO, top: T::ZERO, bottom: T::ZERO }; +} +impl Rect { + /// Returns a Size where the left, right, top, and bottom values are all the zero value of the contained type + /// (e.g. 0.0, Some(0.0), or Dimension::Points(0.0)) + pub const fn zero() -> Self { + zero::() + } +} + +/// Returns the auto value for that type +pub const fn auto() -> T { + T::AUTO +} + +/// Trait to abstract over auto values +pub trait TaffyAuto { + /// The auto value for type implementing TaffyZero + const AUTO: Self; +} +impl TaffyAuto for LengthPercentageAuto { + const AUTO: LengthPercentageAuto = LengthPercentageAuto::Auto; +} +impl TaffyAuto for Dimension { + const AUTO: Dimension = Dimension::Auto; +} +impl TaffyAuto for Option { + const AUTO: Option = Some(T::AUTO); +} +impl TaffyAuto for Point { + const AUTO: Point = Point { x: T::AUTO, y: T::AUTO }; +} +impl Point { + /// Returns a Point where both the x and y values are the auto value of the contained type + /// (e.g. Dimension::Auto or LengthPercentageAuto::Auto) + pub const fn auto() -> Self { + auto::() + } +} +impl TaffyAuto for Size { + const AUTO: Size = Size { width: T::AUTO, height: T::AUTO }; +} +impl Size { + /// Returns a Size where both the width and height values are the auto value of the contained type + /// (e.g. Dimension::Auto or LengthPercentageAuto::Auto) + pub const fn auto() -> Self { + auto::() + } +} +impl TaffyAuto for Rect { + const AUTO: Rect = Rect { left: T::AUTO, right: T::AUTO, top: T::AUTO, bottom: T::AUTO }; +} +impl Rect { + /// Returns a Size where the left, right, top, and bottom values are all the auto value of the contained type + /// (e.g. Dimension::Auto or LengthPercentageAuto::Auto) + pub const fn auto() -> Self { + auto::() + } +} + +/// Returns a value of the inferred type which represent a constant of points +pub fn points + Copy, T: FromPoints>(points: Input) -> T { + T::from_points(points) +} + +/// Trait to create constant points values from plain numbers +pub trait FromPoints { + /// Converts into an Into into Self + fn from_points + Copy>(points: Input) -> Self; +} +impl FromPoints for f32 { + fn from_points + Copy>(points: Input) -> Self { + points.into() + } +} +impl FromPoints for Option { + fn from_points + Copy>(points: Input) -> Self { + Some(points.into()) + } +} +impl FromPoints for LengthPercentage { + fn from_points + Copy>(points: Input) -> Self { + LengthPercentage::Points(points.into()) + } +} +impl FromPoints for LengthPercentageAuto { + fn from_points + Copy>(points: Input) -> Self { + LengthPercentageAuto::Points(points.into()) + } +} +impl FromPoints for Dimension { + fn from_points + Copy>(points: Input) -> Self { + Dimension::Points(points.into()) + } +} +impl FromPoints for Point { + fn from_points + Copy>(points: Input) -> Self { + Point { x: T::from_points(points.into()), y: T::from_points(points.into()) } + } +} +impl Point { + /// Returns a Point where both the x and y values are the constant points value of the contained type + /// (e.g. 2.1, Some(2.1), or Dimension::Points(2.1)) + pub fn points + Copy>(points_value: Input) -> Self { + points::(points_value) + } +} +impl FromPoints for Size { + fn from_points + Copy>(points: Input) -> Self { + Size { width: T::from_points(points.into()), height: T::from_points(points.into()) } + } +} +impl Size { + /// Returns a Size where both the width and height values are the constant points value of the contained type + /// (e.g. 2.1, Some(2.1), or Dimension::Points(2.1)) + pub fn points + Copy>(points_value: Input) -> Self { + points::(points_value) + } +} +impl FromPoints for Rect { + fn from_points + Copy>(points: Input) -> Self { + Rect { + left: T::from_points(points.into()), + right: T::from_points(points.into()), + top: T::from_points(points.into()), + bottom: T::from_points(points.into()), + } + } +} +impl Rect { + /// Returns a Rect where the left, right, top and bottom values are all constant points value of the contained type + /// (e.g. 2.1, Some(2.1), or Dimension::Points(2.1)) + pub fn points + Copy>(points_value: Input) -> Self { + points::(points_value) + } +} diff --git a/tests/generated/absolute_layout_align_items_and_justify_content_center.rs b/tests/generated/absolute_layout_align_items_and_justify_content_center.rs index 98a9670a5..7920ea4cc 100644 --- a/tests/generated/absolute_layout_align_items_and_justify_content_center.rs +++ b/tests/generated/absolute_layout_align_items_and_justify_content_center.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_align_items_and_justify_content_center() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn absolute_layout_align_items_and_justify_content_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -23,7 +25,7 @@ fn absolute_layout_align_items_and_justify_content_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -31,6 +33,9 @@ fn absolute_layout_align_items_and_justify_content_center() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 110f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_align_items_and_justify_content_center_and_bottom_position.rs b/tests/generated/absolute_layout_align_items_and_justify_content_center_and_bottom_position.rs index 3d7029a99..516b885a4 100644 --- a/tests/generated/absolute_layout_align_items_and_justify_content_center_and_bottom_position.rs +++ b/tests/generated/absolute_layout_align_items_and_justify_content_center_and_bottom_position.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_align_items_and_justify_content_center_and_bottom_position() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,11 +10,11 @@ fn absolute_layout_align_items_and_justify_content_center_and_bottom_position() size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() }, ..Default::default() }, @@ -27,7 +29,7 @@ fn absolute_layout_align_items_and_justify_content_center_and_bottom_position() size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -35,6 +37,9 @@ fn absolute_layout_align_items_and_justify_content_center_and_bottom_position() ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 110f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_align_items_and_justify_content_center_and_left_position.rs b/tests/generated/absolute_layout_align_items_and_justify_content_center_and_left_position.rs index 30f66b21a..36ecd614f 100644 --- a/tests/generated/absolute_layout_align_items_and_justify_content_center_and_left_position.rs +++ b/tests/generated/absolute_layout_align_items_and_justify_content_center_and_left_position.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_align_items_and_justify_content_center_and_left_position() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,9 +10,12 @@ fn absolute_layout_align_items_and_justify_content_center_and_left_position() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() + }, + position: taffy::geometry::Rect { + left: taffy::style::LengthPercentageAuto::Points(5f32), + ..Rect::auto() }, - position: taffy::geometry::Rect { left: taffy::style::Dimension::Points(5f32), ..Default::default() }, ..Default::default() }, &[], @@ -24,7 +29,7 @@ fn absolute_layout_align_items_and_justify_content_center_and_left_position() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,6 +37,9 @@ fn absolute_layout_align_items_and_justify_content_center_and_left_position() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 110f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_align_items_and_justify_content_center_and_right_position.rs b/tests/generated/absolute_layout_align_items_and_justify_content_center_and_right_position.rs index 29be89e91..2112e4408 100644 --- a/tests/generated/absolute_layout_align_items_and_justify_content_center_and_right_position.rs +++ b/tests/generated/absolute_layout_align_items_and_justify_content_center_and_right_position.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_align_items_and_justify_content_center_and_right_position() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,9 +10,12 @@ fn absolute_layout_align_items_and_justify_content_center_and_right_position() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() + }, + position: taffy::geometry::Rect { + right: taffy::style::LengthPercentageAuto::Points(5f32), + ..Rect::auto() }, - position: taffy::geometry::Rect { right: taffy::style::Dimension::Points(5f32), ..Default::default() }, ..Default::default() }, &[], @@ -24,7 +29,7 @@ fn absolute_layout_align_items_and_justify_content_center_and_right_position() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,6 +37,9 @@ fn absolute_layout_align_items_and_justify_content_center_and_right_position() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 110f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_align_items_and_justify_content_center_and_top_position.rs b/tests/generated/absolute_layout_align_items_and_justify_content_center_and_top_position.rs index 354d6d591..020fbc355 100644 --- a/tests/generated/absolute_layout_align_items_and_justify_content_center_and_top_position.rs +++ b/tests/generated/absolute_layout_align_items_and_justify_content_center_and_top_position.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_align_items_and_justify_content_center_and_top_position() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,9 +10,12 @@ fn absolute_layout_align_items_and_justify_content_center_and_top_position() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() + }, + position: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() }, - position: taffy::geometry::Rect { top: taffy::style::Dimension::Points(10f32), ..Default::default() }, ..Default::default() }, &[], @@ -24,7 +29,7 @@ fn absolute_layout_align_items_and_justify_content_center_and_top_position() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,6 +37,9 @@ fn absolute_layout_align_items_and_justify_content_center_and_top_position() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 110f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_align_items_and_justify_content_flex_end.rs b/tests/generated/absolute_layout_align_items_and_justify_content_flex_end.rs index 5437bc880..30fb9232f 100644 --- a/tests/generated/absolute_layout_align_items_and_justify_content_flex_end.rs +++ b/tests/generated/absolute_layout_align_items_and_justify_content_flex_end.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_align_items_and_justify_content_flex_end() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn absolute_layout_align_items_and_justify_content_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -23,7 +25,7 @@ fn absolute_layout_align_items_and_justify_content_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -31,6 +33,9 @@ fn absolute_layout_align_items_and_justify_content_flex_end() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 110f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_align_items_center.rs b/tests/generated/absolute_layout_align_items_center.rs index 9dbd89669..ab47b3e27 100644 --- a/tests/generated/absolute_layout_align_items_center.rs +++ b/tests/generated/absolute_layout_align_items_center.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_align_items_center() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn absolute_layout_align_items_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,7 +24,7 @@ fn absolute_layout_align_items_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,6 +32,9 @@ fn absolute_layout_align_items_center() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 110f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_align_items_center_on_child_only.rs b/tests/generated/absolute_layout_align_items_center_on_child_only.rs index 9202dc06f..6d6f2bdc3 100644 --- a/tests/generated/absolute_layout_align_items_center_on_child_only.rs +++ b/tests/generated/absolute_layout_align_items_center_on_child_only.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_align_items_center_on_child_only() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -9,7 +11,7 @@ fn absolute_layout_align_items_center_on_child_only() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,7 +24,7 @@ fn absolute_layout_align_items_center_on_child_only() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,6 +32,9 @@ fn absolute_layout_align_items_center_on_child_only() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 110f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_child_order.rs b/tests/generated/absolute_layout_child_order.rs index 8880c472c..05f9f1d16 100644 --- a/tests/generated/absolute_layout_child_order.rs +++ b/tests/generated/absolute_layout_child_order.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_child_order() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn absolute_layout_child_order() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ fn absolute_layout_child_order() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,7 +36,7 @@ fn absolute_layout_child_order() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -49,7 +51,7 @@ fn absolute_layout_child_order() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -57,6 +59,9 @@ fn absolute_layout_child_order() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 110f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_in_wrap_reverse_column_container.rs b/tests/generated/absolute_layout_in_wrap_reverse_column_container.rs index a1bbc224b..c5b44537f 100644 --- a/tests/generated/absolute_layout_in_wrap_reverse_column_container.rs +++ b/tests/generated/absolute_layout_in_wrap_reverse_column_container.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_in_wrap_reverse_column_container() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn absolute_layout_in_wrap_reverse_column_container() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -23,7 +25,7 @@ fn absolute_layout_in_wrap_reverse_column_container() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -31,6 +33,9 @@ fn absolute_layout_in_wrap_reverse_column_container() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_in_wrap_reverse_column_container_flex_end.rs b/tests/generated/absolute_layout_in_wrap_reverse_column_container_flex_end.rs index e0cf89dd4..7b4a4bfca 100644 --- a/tests/generated/absolute_layout_in_wrap_reverse_column_container_flex_end.rs +++ b/tests/generated/absolute_layout_in_wrap_reverse_column_container_flex_end.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_in_wrap_reverse_column_container_flex_end() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -9,7 +11,7 @@ fn absolute_layout_in_wrap_reverse_column_container_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -24,7 +26,7 @@ fn absolute_layout_in_wrap_reverse_column_container_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,6 +34,9 @@ fn absolute_layout_in_wrap_reverse_column_container_flex_end() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_in_wrap_reverse_row_container.rs b/tests/generated/absolute_layout_in_wrap_reverse_row_container.rs index e6cff67ac..ce7fcc3f9 100644 --- a/tests/generated/absolute_layout_in_wrap_reverse_row_container.rs +++ b/tests/generated/absolute_layout_in_wrap_reverse_row_container.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_in_wrap_reverse_row_container() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn absolute_layout_in_wrap_reverse_row_container() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,7 +24,7 @@ fn absolute_layout_in_wrap_reverse_row_container() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,6 +32,9 @@ fn absolute_layout_in_wrap_reverse_row_container() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_in_wrap_reverse_row_container_flex_end.rs b/tests/generated/absolute_layout_in_wrap_reverse_row_container_flex_end.rs index 2e0d053bc..758bc5ed3 100644 --- a/tests/generated/absolute_layout_in_wrap_reverse_row_container_flex_end.rs +++ b/tests/generated/absolute_layout_in_wrap_reverse_row_container_flex_end.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_in_wrap_reverse_row_container_flex_end() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -9,7 +11,7 @@ fn absolute_layout_in_wrap_reverse_row_container_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -23,7 +25,7 @@ fn absolute_layout_in_wrap_reverse_row_container_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -31,6 +33,9 @@ fn absolute_layout_in_wrap_reverse_row_container_flex_end() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_justify_content_center.rs b/tests/generated/absolute_layout_justify_content_center.rs index a6f48dbf8..51f2198f1 100644 --- a/tests/generated/absolute_layout_justify_content_center.rs +++ b/tests/generated/absolute_layout_justify_content_center.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_justify_content_center() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn absolute_layout_justify_content_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,7 +24,7 @@ fn absolute_layout_justify_content_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(110f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,6 +32,9 @@ fn absolute_layout_justify_content_center() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 110f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_no_size.rs b/tests/generated/absolute_layout_no_size.rs index a59e52c16..14a963bca 100644 --- a/tests/generated/absolute_layout_no_size.rs +++ b/tests/generated/absolute_layout_no_size.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_no_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -13,7 +15,7 @@ fn absolute_layout_no_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,6 +23,9 @@ fn absolute_layout_no_size() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_percentage_bottom_based_on_parent_height.rs b/tests/generated/absolute_layout_percentage_bottom_based_on_parent_height.rs index 1e94e04ea..06dae4cc2 100644 --- a/tests/generated/absolute_layout_percentage_bottom_based_on_parent_height.rs +++ b/tests/generated/absolute_layout_percentage_bottom_based_on_parent_height.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_percentage_bottom_based_on_parent_height() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,9 +10,12 @@ fn absolute_layout_percentage_bottom_based_on_parent_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() + }, + position: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Percent(0.5f32), + ..Rect::auto() }, - position: taffy::geometry::Rect { top: taffy::style::Dimension::Percent(0.5f32), ..Default::default() }, ..Default::default() }, &[], @@ -23,11 +28,11 @@ fn absolute_layout_percentage_bottom_based_on_parent_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - bottom: taffy::style::Dimension::Percent(0.5f32), - ..Default::default() + bottom: taffy::style::LengthPercentageAuto::Percent(0.5f32), + ..Rect::auto() }, ..Default::default() }, @@ -38,11 +43,11 @@ fn absolute_layout_percentage_bottom_based_on_parent_height() { .new_with_children( taffy::style::Style { position_type: taffy::style::PositionType::Absolute, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, position: taffy::geometry::Rect { - top: taffy::style::Dimension::Percent(0.1f32), - bottom: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Percent(0.1f32), + bottom: taffy::style::LengthPercentageAuto::Percent(0.1f32), + ..Rect::auto() }, ..Default::default() }, @@ -55,7 +60,7 @@ fn absolute_layout_percentage_bottom_based_on_parent_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -63,6 +68,9 @@ fn absolute_layout_percentage_bottom_based_on_parent_height() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_start_top_end_bottom.rs b/tests/generated/absolute_layout_start_top_end_bottom.rs index f77b12913..58ed62336 100644 --- a/tests/generated/absolute_layout_start_top_end_bottom.rs +++ b/tests/generated/absolute_layout_start_top_end_bottom.rs @@ -1,16 +1,18 @@ #[test] fn absolute_layout_start_top_end_bottom() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { position_type: taffy::style::PositionType::Absolute, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() }, ..Default::default() }, @@ -23,7 +25,7 @@ fn absolute_layout_start_top_end_bottom() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -31,6 +33,9 @@ fn absolute_layout_start_top_end_bottom() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_width_height_end_bottom.rs b/tests/generated/absolute_layout_width_height_end_bottom.rs index 5ef93ddbd..394218f9d 100644 --- a/tests/generated/absolute_layout_width_height_end_bottom.rs +++ b/tests/generated/absolute_layout_width_height_end_bottom.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_width_height_end_bottom() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,12 +10,12 @@ fn absolute_layout_width_height_end_bottom() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - right: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + right: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() }, ..Default::default() }, @@ -26,7 +28,7 @@ fn absolute_layout_width_height_end_bottom() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,6 +36,9 @@ fn absolute_layout_width_height_end_bottom() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_width_height_start_top.rs b/tests/generated/absolute_layout_width_height_start_top.rs index fd0af4c56..8eee4f907 100644 --- a/tests/generated/absolute_layout_width_height_start_top.rs +++ b/tests/generated/absolute_layout_width_height_start_top.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_width_height_start_top() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,12 +10,12 @@ fn absolute_layout_width_height_start_top() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() }, ..Default::default() }, @@ -26,7 +28,7 @@ fn absolute_layout_width_height_start_top() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,6 +36,9 @@ fn absolute_layout_width_height_start_top() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_width_height_start_top_end_bottom.rs b/tests/generated/absolute_layout_width_height_start_top_end_bottom.rs index 890bc0bf9..3f428014c 100644 --- a/tests/generated/absolute_layout_width_height_start_top_end_bottom.rs +++ b/tests/generated/absolute_layout_width_height_start_top_end_bottom.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_width_height_start_top_end_bottom() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,14 +10,14 @@ fn absolute_layout_width_height_start_top_end_bottom() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() }, ..Default::default() }, @@ -28,7 +30,7 @@ fn absolute_layout_width_height_start_top_end_bottom() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -36,6 +38,9 @@ fn absolute_layout_width_height_start_top_end_bottom() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/absolute_layout_within_border.rs b/tests/generated/absolute_layout_within_border.rs index 138b5f1a6..f68df8f22 100644 --- a/tests/generated/absolute_layout_within_border.rs +++ b/tests/generated/absolute_layout_within_border.rs @@ -1,5 +1,7 @@ #[test] fn absolute_layout_within_border() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,12 +10,12 @@ fn absolute_layout_within_border() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(0f32), - top: taffy::style::Dimension::Points(0f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(0f32), + top: taffy::style::LengthPercentageAuto::Points(0f32), + ..Rect::auto() }, ..Default::default() }, @@ -27,12 +29,12 @@ fn absolute_layout_within_border() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - right: taffy::style::Dimension::Points(0f32), - bottom: taffy::style::Dimension::Points(0f32), - ..Default::default() + right: taffy::style::LengthPercentageAuto::Points(0f32), + bottom: taffy::style::LengthPercentageAuto::Points(0f32), + ..Rect::auto() }, ..Default::default() }, @@ -46,19 +48,19 @@ fn absolute_layout_within_border() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(0f32), - top: taffy::style::Dimension::Points(0f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(0f32), + top: taffy::style::LengthPercentageAuto::Points(0f32), + ..Rect::auto() }, ..Default::default() }, @@ -72,19 +74,19 @@ fn absolute_layout_within_border() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, position: taffy::geometry::Rect { - right: taffy::style::Dimension::Points(0f32), - bottom: taffy::style::Dimension::Points(0f32), - ..Default::default() + right: taffy::style::LengthPercentageAuto::Points(0f32), + bottom: taffy::style::LengthPercentageAuto::Points(0f32), + ..Rect::auto() }, ..Default::default() }, @@ -97,21 +99,21 @@ fn absolute_layout_within_border() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, border: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -119,6 +121,9 @@ fn absolute_layout_within_border() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_baseline.rs b/tests/generated/align_baseline.rs index c7a63a436..e7dad6eb4 100644 --- a/tests/generated/align_baseline.rs +++ b/tests/generated/align_baseline.rs @@ -1,5 +1,7 @@ #[test] fn align_baseline() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_baseline() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn align_baseline() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,7 +36,7 @@ fn align_baseline() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -42,6 +44,9 @@ fn align_baseline() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_baseline_child_multiline.rs b/tests/generated/align_baseline_child_multiline.rs index e6f1cf41d..20c87c5f9 100644 --- a/tests/generated/align_baseline_child_multiline.rs +++ b/tests/generated/align_baseline_child_multiline.rs @@ -1,5 +1,7 @@ #[test] fn align_baseline_child_multiline() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_baseline_child_multiline() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(60f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn align_baseline_child_multiline() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(25f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn align_baseline_child_multiline() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(25f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn align_baseline_child_multiline() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(25f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn align_baseline_child_multiline() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(25f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -70,7 +72,7 @@ fn align_baseline_child_multiline() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[node10, node11, node12, node13], @@ -80,13 +82,16 @@ fn align_baseline_child_multiline() { .new_with_children( taffy::style::Style { align_items: taffy::style::AlignItems::Baseline, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 80f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_baseline_nested_child.rs b/tests/generated/align_baseline_nested_child.rs index 2ef52b6d7..3770afc30 100644 --- a/tests/generated/align_baseline_nested_child.rs +++ b/tests/generated/align_baseline_nested_child.rs @@ -1,5 +1,7 @@ #[test] fn align_baseline_nested_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_baseline_nested_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn align_baseline_nested_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,7 +36,7 @@ fn align_baseline_nested_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -48,7 +50,7 @@ fn align_baseline_nested_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -56,6 +58,9 @@ fn align_baseline_nested_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_center_should_size_based_on_content.rs b/tests/generated/align_center_should_size_based_on_content.rs index 13a2ce2a7..c0cd0a483 100644 --- a/tests/generated/align_center_should_size_based_on_content.rs +++ b/tests/generated/align_center_should_size_based_on_content.rs @@ -1,5 +1,7 @@ #[test] fn align_center_should_size_based_on_content() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_center_should_size_based_on_content() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -35,7 +37,7 @@ fn align_center_should_size_based_on_content() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn align_center_should_size_based_on_content() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_content_space_around_single_line.rs b/tests/generated/align_content_space_around_single_line.rs index d4b6d2568..e42b556d4 100644 --- a/tests/generated/align_content_space_around_single_line.rs +++ b/tests/generated/align_content_space_around_single_line.rs @@ -1,5 +1,7 @@ #[test] fn align_content_space_around_single_line() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_content_space_around_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn align_content_space_around_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn align_content_space_around_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn align_content_space_around_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn align_content_space_around_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -72,7 +74,7 @@ fn align_content_space_around_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -86,7 +88,7 @@ fn align_content_space_around_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -94,6 +96,9 @@ fn align_content_space_around_single_line() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_content_space_around_wrapped.rs b/tests/generated/align_content_space_around_wrapped.rs index c5b5fdf69..529ab9cff 100644 --- a/tests/generated/align_content_space_around_wrapped.rs +++ b/tests/generated/align_content_space_around_wrapped.rs @@ -1,5 +1,7 @@ #[test] fn align_content_space_around_wrapped() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_content_space_around_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn align_content_space_around_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn align_content_space_around_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn align_content_space_around_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn align_content_space_around_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -72,7 +74,7 @@ fn align_content_space_around_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -87,7 +89,7 @@ fn align_content_space_around_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -95,6 +97,9 @@ fn align_content_space_around_wrapped() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_content_space_between_single_line.rs b/tests/generated/align_content_space_between_single_line.rs index c2c8804d4..0b142df88 100644 --- a/tests/generated/align_content_space_between_single_line.rs +++ b/tests/generated/align_content_space_between_single_line.rs @@ -1,5 +1,7 @@ #[test] fn align_content_space_between_single_line() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_content_space_between_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn align_content_space_between_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn align_content_space_between_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn align_content_space_between_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn align_content_space_between_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -72,7 +74,7 @@ fn align_content_space_between_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -86,7 +88,7 @@ fn align_content_space_between_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -94,6 +96,9 @@ fn align_content_space_between_single_line() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_content_space_between_wrapped.rs b/tests/generated/align_content_space_between_wrapped.rs index d30813840..dea6cf26b 100644 --- a/tests/generated/align_content_space_between_wrapped.rs +++ b/tests/generated/align_content_space_between_wrapped.rs @@ -1,5 +1,7 @@ #[test] fn align_content_space_between_wrapped() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_content_space_between_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn align_content_space_between_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn align_content_space_between_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn align_content_space_between_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn align_content_space_between_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -72,7 +74,7 @@ fn align_content_space_between_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -87,7 +89,7 @@ fn align_content_space_between_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -95,6 +97,9 @@ fn align_content_space_between_wrapped() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_content_space_evenly_single_line.rs b/tests/generated/align_content_space_evenly_single_line.rs index 9c3f1cfaa..0cf2e3fe1 100644 --- a/tests/generated/align_content_space_evenly_single_line.rs +++ b/tests/generated/align_content_space_evenly_single_line.rs @@ -1,5 +1,7 @@ #[test] fn align_content_space_evenly_single_line() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_content_space_evenly_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn align_content_space_evenly_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn align_content_space_evenly_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn align_content_space_evenly_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn align_content_space_evenly_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -72,7 +74,7 @@ fn align_content_space_evenly_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -86,7 +88,7 @@ fn align_content_space_evenly_single_line() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -94,6 +96,9 @@ fn align_content_space_evenly_single_line() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_content_space_evenly_wrapped.rs b/tests/generated/align_content_space_evenly_wrapped.rs index 6283490d2..e90a1a931 100644 --- a/tests/generated/align_content_space_evenly_wrapped.rs +++ b/tests/generated/align_content_space_evenly_wrapped.rs @@ -1,5 +1,7 @@ #[test] fn align_content_space_evenly_wrapped() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_content_space_evenly_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn align_content_space_evenly_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn align_content_space_evenly_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn align_content_space_evenly_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn align_content_space_evenly_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -72,7 +74,7 @@ fn align_content_space_evenly_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -87,7 +89,7 @@ fn align_content_space_evenly_wrapped() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -95,6 +97,9 @@ fn align_content_space_evenly_wrapped() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_flex_start_with_shrinking_children.rs b/tests/generated/align_flex_start_with_shrinking_children.rs index 731929b13..673239c86 100644 --- a/tests/generated/align_flex_start_with_shrinking_children.rs +++ b/tests/generated/align_flex_start_with_shrinking_children.rs @@ -1,5 +1,7 @@ #[test] fn align_flex_start_with_shrinking_children() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children(taffy::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() }, &[]) @@ -19,7 +21,7 @@ fn align_flex_start_with_shrinking_children() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -27,6 +29,9 @@ fn align_flex_start_with_shrinking_children() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 500f32); assert_eq!(taffy.layout(node).unwrap().size.height, 500f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_flex_start_with_shrinking_children_with_stretch.rs b/tests/generated/align_flex_start_with_shrinking_children_with_stretch.rs index 087f73268..8af478bcd 100644 --- a/tests/generated/align_flex_start_with_shrinking_children_with_stretch.rs +++ b/tests/generated/align_flex_start_with_shrinking_children_with_stretch.rs @@ -1,5 +1,7 @@ #[test] fn align_flex_start_with_shrinking_children_with_stretch() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children(taffy::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() }, &[]) @@ -19,7 +21,7 @@ fn align_flex_start_with_shrinking_children_with_stretch() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -27,6 +29,9 @@ fn align_flex_start_with_shrinking_children_with_stretch() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 500f32); assert_eq!(taffy.layout(node).unwrap().size.height, 500f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_flex_start_with_stretching_children.rs b/tests/generated/align_flex_start_with_stretching_children.rs index 496da8fdd..3a2c4081c 100644 --- a/tests/generated/align_flex_start_with_stretching_children.rs +++ b/tests/generated/align_flex_start_with_stretching_children.rs @@ -1,5 +1,7 @@ #[test] fn align_flex_start_with_stretching_children() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children(taffy::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() }, &[]) @@ -14,7 +16,7 @@ fn align_flex_start_with_stretching_children() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,6 +24,9 @@ fn align_flex_start_with_stretching_children() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 500f32); assert_eq!(taffy.layout(node).unwrap().size.height, 500f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_items_center.rs b/tests/generated/align_items_center.rs index 40e74dc22..989e29d59 100644 --- a/tests/generated/align_items_center.rs +++ b/tests/generated/align_items_center.rs @@ -1,5 +1,7 @@ #[test] fn align_items_center() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_items_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ fn align_items_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -29,6 +31,9 @@ fn align_items_center() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_items_center_child_with_margin_bigger_than_parent.rs b/tests/generated/align_items_center_child_with_margin_bigger_than_parent.rs index ddb227b88..138d6a81c 100644 --- a/tests/generated/align_items_center_child_with_margin_bigger_than_parent.rs +++ b/tests/generated/align_items_center_child_with_margin_bigger_than_parent.rs @@ -1,5 +1,7 @@ #[test] fn align_items_center_child_with_margin_bigger_than_parent() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,12 +9,12 @@ fn align_items_center_child_with_margin_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn align_items_center_child_with_margin_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -41,6 +43,9 @@ fn align_items_center_child_with_margin_bigger_than_parent() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 50f32); assert_eq!(taffy.layout(node).unwrap().size.height, 50f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_items_center_child_without_margin_bigger_than_parent.rs b/tests/generated/align_items_center_child_without_margin_bigger_than_parent.rs index 5b8cd441a..4498374ce 100644 --- a/tests/generated/align_items_center_child_without_margin_bigger_than_parent.rs +++ b/tests/generated/align_items_center_child_without_margin_bigger_than_parent.rs @@ -1,5 +1,7 @@ #[test] fn align_items_center_child_without_margin_bigger_than_parent() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_items_center_child_without_margin_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(70f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -28,7 +30,7 @@ fn align_items_center_child_without_margin_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -36,6 +38,9 @@ fn align_items_center_child_without_margin_bigger_than_parent() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 50f32); assert_eq!(taffy.layout(node).unwrap().size.height, 50f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_items_center_with_child_margin.rs b/tests/generated/align_items_center_with_child_margin.rs index 3dc86233c..0e72112a3 100644 --- a/tests/generated/align_items_center_with_child_margin.rs +++ b/tests/generated/align_items_center_with_child_margin.rs @@ -1,5 +1,7 @@ #[test] fn align_items_center_with_child_margin() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,12 @@ fn align_items_center_with_child_margin() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() + }, + margin: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Points(10f32), ..Default::default() }, ..Default::default() }, &[], @@ -22,7 +27,7 @@ fn align_items_center_with_child_margin() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,6 +35,9 @@ fn align_items_center_with_child_margin() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_items_center_with_child_top.rs b/tests/generated/align_items_center_with_child_top.rs index e55868e00..67ad83ca7 100644 --- a/tests/generated/align_items_center_with_child_top.rs +++ b/tests/generated/align_items_center_with_child_top.rs @@ -1,5 +1,7 @@ #[test] fn align_items_center_with_child_top() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,12 @@ fn align_items_center_with_child_top() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() + }, + position: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() }, - position: taffy::geometry::Rect { top: taffy::style::Dimension::Points(10f32), ..Default::default() }, ..Default::default() }, &[], @@ -22,7 +27,7 @@ fn align_items_center_with_child_top() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,6 +35,9 @@ fn align_items_center_with_child_top() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_items_flex_end.rs b/tests/generated/align_items_flex_end.rs index 09eb2891c..ca6056404 100644 --- a/tests/generated/align_items_flex_end.rs +++ b/tests/generated/align_items_flex_end.rs @@ -1,5 +1,7 @@ #[test] fn align_items_flex_end() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_items_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ fn align_items_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -29,6 +31,9 @@ fn align_items_flex_end() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_items_flex_end_child_with_margin_bigger_than_parent.rs b/tests/generated/align_items_flex_end_child_with_margin_bigger_than_parent.rs index 19db7d4c0..f1739f1b4 100644 --- a/tests/generated/align_items_flex_end_child_with_margin_bigger_than_parent.rs +++ b/tests/generated/align_items_flex_end_child_with_margin_bigger_than_parent.rs @@ -1,5 +1,7 @@ #[test] fn align_items_flex_end_child_with_margin_bigger_than_parent() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,12 +9,12 @@ fn align_items_flex_end_child_with_margin_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn align_items_flex_end_child_with_margin_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -41,6 +43,9 @@ fn align_items_flex_end_child_with_margin_bigger_than_parent() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 50f32); assert_eq!(taffy.layout(node).unwrap().size.height, 50f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_items_flex_end_child_without_margin_bigger_than_parent.rs b/tests/generated/align_items_flex_end_child_without_margin_bigger_than_parent.rs index b023a1d7f..2982fe8a1 100644 --- a/tests/generated/align_items_flex_end_child_without_margin_bigger_than_parent.rs +++ b/tests/generated/align_items_flex_end_child_without_margin_bigger_than_parent.rs @@ -1,5 +1,7 @@ #[test] fn align_items_flex_end_child_without_margin_bigger_than_parent() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_items_flex_end_child_without_margin_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(70f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -28,7 +30,7 @@ fn align_items_flex_end_child_without_margin_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -36,6 +38,9 @@ fn align_items_flex_end_child_without_margin_bigger_than_parent() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 50f32); assert_eq!(taffy.layout(node).unwrap().size.height, 50f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_items_flex_start.rs b/tests/generated/align_items_flex_start.rs index 5419717a5..3bc616a82 100644 --- a/tests/generated/align_items_flex_start.rs +++ b/tests/generated/align_items_flex_start.rs @@ -1,5 +1,7 @@ #[test] fn align_items_flex_start() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_items_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ fn align_items_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -29,6 +31,9 @@ fn align_items_flex_start() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_items_min_max.rs b/tests/generated/align_items_min_max.rs index c35fe6060..47153b753 100644 --- a/tests/generated/align_items_min_max.rs +++ b/tests/generated/align_items_min_max.rs @@ -1,5 +1,7 @@ #[test] fn align_items_min_max() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_items_min_max() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(60f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,21 +21,18 @@ fn align_items_min_max() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, align_items: taffy::style::AlignItems::Center, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(200f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_items_stretch.rs b/tests/generated/align_items_stretch.rs index 89c78b866..935138e2b 100644 --- a/tests/generated/align_items_stretch.rs +++ b/tests/generated/align_items_stretch.rs @@ -1,10 +1,12 @@ #[test] fn align_items_stretch() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,7 +18,7 @@ fn align_items_stretch() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -24,6 +26,9 @@ fn align_items_stretch() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_self_baseline.rs b/tests/generated/align_self_baseline.rs index 702bf4329..096623bd9 100644 --- a/tests/generated/align_self_baseline.rs +++ b/tests/generated/align_self_baseline.rs @@ -1,5 +1,7 @@ #[test] fn align_self_baseline() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn align_self_baseline() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ fn align_self_baseline() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -35,7 +37,7 @@ fn align_self_baseline() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -48,7 +50,7 @@ fn align_self_baseline() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -56,6 +58,9 @@ fn align_self_baseline() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_self_center.rs b/tests/generated/align_self_center.rs index 6a705b2a2..a8475802c 100644 --- a/tests/generated/align_self_center.rs +++ b/tests/generated/align_self_center.rs @@ -1,5 +1,7 @@ #[test] fn align_self_center() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn align_self_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ fn align_self_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -29,6 +31,9 @@ fn align_self_center() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_self_flex_end.rs b/tests/generated/align_self_flex_end.rs index ebdb903e7..2ab37850a 100644 --- a/tests/generated/align_self_flex_end.rs +++ b/tests/generated/align_self_flex_end.rs @@ -1,5 +1,7 @@ #[test] fn align_self_flex_end() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn align_self_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ fn align_self_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -29,6 +31,9 @@ fn align_self_flex_end() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_self_flex_end_override_flex_start.rs b/tests/generated/align_self_flex_end_override_flex_start.rs index 992f56086..6fc597753 100644 --- a/tests/generated/align_self_flex_end_override_flex_start.rs +++ b/tests/generated/align_self_flex_end_override_flex_start.rs @@ -1,5 +1,7 @@ #[test] fn align_self_flex_end_override_flex_start() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn align_self_flex_end_override_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,7 +24,7 @@ fn align_self_flex_end_override_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,6 +32,9 @@ fn align_self_flex_end_override_flex_start() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_self_flex_start.rs b/tests/generated/align_self_flex_start.rs index ad88302a4..23c382088 100644 --- a/tests/generated/align_self_flex_start.rs +++ b/tests/generated/align_self_flex_start.rs @@ -1,5 +1,7 @@ #[test] fn align_self_flex_start() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn align_self_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ fn align_self_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -29,6 +31,9 @@ fn align_self_flex_start() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/align_strech_should_size_based_on_parent.rs b/tests/generated/align_strech_should_size_based_on_parent.rs index 7e693c14f..c6a85a454 100644 --- a/tests/generated/align_strech_should_size_based_on_parent.rs +++ b/tests/generated/align_strech_should_size_based_on_parent.rs @@ -1,5 +1,7 @@ #[test] fn align_strech_should_size_based_on_parent() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn align_strech_should_size_based_on_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,7 +36,7 @@ fn align_strech_should_size_based_on_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -42,6 +44,9 @@ fn align_strech_should_size_based_on_parent() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/border_center_child.rs b/tests/generated/border_center_child.rs index cefeb2a0c..7534f9722 100644 --- a/tests/generated/border_center_child.rs +++ b/tests/generated/border_center_child.rs @@ -1,5 +1,7 @@ #[test] fn border_center_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn border_center_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,12 +24,12 @@ fn border_center_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, border: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(20f32), - ..Default::default() + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(20f32), + ..Rect::zero() }, ..Default::default() }, @@ -35,6 +37,9 @@ fn border_center_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/border_flex_child.rs b/tests/generated/border_flex_child.rs index 9d47a97f7..8b032d3f9 100644 --- a/tests/generated/border_flex_child.rs +++ b/tests/generated/border_flex_child.rs @@ -1,11 +1,13 @@ #[test] fn border_flex_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -17,14 +19,14 @@ fn border_flex_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, border: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -32,6 +34,9 @@ fn border_flex_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/border_no_child.rs b/tests/generated/border_no_child.rs index 6033b8326..1afbf7bd5 100644 --- a/tests/generated/border_no_child.rs +++ b/tests/generated/border_no_child.rs @@ -1,15 +1,17 @@ #[test] fn border_no_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node = taffy .new_with_children( taffy::style::Style { border: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -17,6 +19,9 @@ fn border_no_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 20f32); assert_eq!(taffy.layout(node).unwrap().size.height, 20f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/border_stretch_child.rs b/tests/generated/border_stretch_child.rs index a21ad850c..d8d2a1c66 100644 --- a/tests/generated/border_stretch_child.rs +++ b/tests/generated/border_stretch_child.rs @@ -1,10 +1,12 @@ #[test] fn border_stretch_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,14 +18,14 @@ fn border_stretch_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, border: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -31,6 +33,9 @@ fn border_stretch_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/child_min_max_width_flexing.rs b/tests/generated/child_min_max_width_flexing.rs index e10a4c8d4..d6c48c27e 100644 --- a/tests/generated/child_min_max_width_flexing.rs +++ b/tests/generated/child_min_max_width_flexing.rs @@ -1,5 +1,7 @@ #[test] fn child_min_max_width_flexing() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn child_min_max_width_flexing() { flex_grow: 1f32, flex_shrink: 0f32, flex_basis: taffy::style::Dimension::Points(0f32), - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -19,7 +21,7 @@ fn child_min_max_width_flexing() { flex_grow: 1f32, flex_shrink: 0f32, flex_basis: taffy::style::Dimension::Percent(0.5f32), - max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -31,7 +33,7 @@ fn child_min_max_width_flexing() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(120f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -39,6 +41,9 @@ fn child_min_max_width_flexing() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 120f32); assert_eq!(taffy.layout(node).unwrap().size.height, 50f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/container_with_unsized_child.rs b/tests/generated/container_with_unsized_child.rs index c6cf15a16..77edc2c48 100644 --- a/tests/generated/container_with_unsized_child.rs +++ b/tests/generated/container_with_unsized_child.rs @@ -1,5 +1,7 @@ #[test] fn container_with_unsized_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[]).unwrap(); let node = taffy @@ -8,7 +10,7 @@ fn container_with_unsized_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -16,6 +18,9 @@ fn container_with_unsized_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/display_none.rs b/tests/generated/display_none.rs index 3207d6a43..5b6ca2406 100644 --- a/tests/generated/display_none.rs +++ b/tests/generated/display_none.rs @@ -1,5 +1,7 @@ #[test] fn display_none() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy @@ -14,7 +16,7 @@ fn display_none() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,6 +24,9 @@ fn display_none() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/display_none_fixed_size.rs b/tests/generated/display_none_fixed_size.rs index 0d83ae4cf..41fc1dec5 100644 --- a/tests/generated/display_none_fixed_size.rs +++ b/tests/generated/display_none_fixed_size.rs @@ -1,5 +1,7 @@ #[test] fn display_none_fixed_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy @@ -9,7 +11,7 @@ fn display_none_fixed_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,7 +24,7 @@ fn display_none_fixed_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,6 +32,9 @@ fn display_none_fixed_size() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/display_none_with_child.rs b/tests/generated/display_none_with_child.rs index 79afc0ce5..9bbc3d827 100644 --- a/tests/generated/display_none_with_child.rs +++ b/tests/generated/display_none_with_child.rs @@ -1,5 +1,7 @@ #[test] fn display_none_with_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -18,7 +20,7 @@ fn display_none_with_child() { flex_grow: 1f32, flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -54,7 +56,7 @@ fn display_none_with_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -62,6 +64,9 @@ fn display_none_with_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/display_none_with_margin.rs b/tests/generated/display_none_with_margin.rs index 63d0a3bd3..57eafe47a 100644 --- a/tests/generated/display_none_with_margin.rs +++ b/tests/generated/display_none_with_margin.rs @@ -1,5 +1,7 @@ #[test] fn display_none_with_margin() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,14 +10,14 @@ fn display_none_with_margin() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -29,7 +31,7 @@ fn display_none_with_margin() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -37,6 +39,9 @@ fn display_none_with_margin() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/display_none_with_position.rs b/tests/generated/display_none_with_position.rs index 716c7ac46..91a6593f4 100644 --- a/tests/generated/display_none_with_position.rs +++ b/tests/generated/display_none_with_position.rs @@ -1,5 +1,7 @@ #[test] fn display_none_with_position() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy @@ -7,7 +9,10 @@ fn display_none_with_position() { taffy::style::Style { display: taffy::style::Display::None, flex_grow: 1f32, - position: taffy::geometry::Rect { top: taffy::style::Dimension::Points(10f32), ..Default::default() }, + position: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::auto() + }, ..Default::default() }, &[], @@ -19,7 +24,7 @@ fn display_none_with_position() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -27,6 +32,9 @@ fn display_none_with_position() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_and_main_dimen_set_when_flexing.rs b/tests/generated/flex_basis_and_main_dimen_set_when_flexing.rs index 89aaf5870..d6ca88fd7 100644 --- a/tests/generated/flex_basis_and_main_dimen_set_when_flexing.rs +++ b/tests/generated/flex_basis_and_main_dimen_set_when_flexing.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_and_main_dimen_set_when_flexing() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -9,7 +11,7 @@ fn flex_basis_and_main_dimen_set_when_flexing() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -24,7 +26,7 @@ fn flex_basis_and_main_dimen_set_when_flexing() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,13 +36,16 @@ fn flex_basis_and_main_dimen_set_when_flexing() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 50f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_flex_grow_column.rs b/tests/generated/flex_basis_flex_grow_column.rs index 4225248ed..7ffff5db4 100644 --- a/tests/generated/flex_basis_flex_grow_column.rs +++ b/tests/generated/flex_basis_flex_grow_column.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_flex_grow_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -19,7 +21,7 @@ fn flex_basis_flex_grow_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -27,6 +29,9 @@ fn flex_basis_flex_grow_column() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_flex_grow_row.rs b/tests/generated/flex_basis_flex_grow_row.rs index a3d10e19d..147120f8b 100644 --- a/tests/generated/flex_basis_flex_grow_row.rs +++ b/tests/generated/flex_basis_flex_grow_row.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_flex_grow_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -18,7 +20,7 @@ fn flex_basis_flex_grow_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -26,6 +28,9 @@ fn flex_basis_flex_grow_row() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_flex_shrink_column.rs b/tests/generated/flex_basis_flex_shrink_column.rs index c86e05817..1cc10d84e 100644 --- a/tests/generated/flex_basis_flex_shrink_column.rs +++ b/tests/generated/flex_basis_flex_shrink_column.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_flex_shrink_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -20,7 +22,7 @@ fn flex_basis_flex_shrink_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -28,6 +30,9 @@ fn flex_basis_flex_shrink_column() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_flex_shrink_row.rs b/tests/generated/flex_basis_flex_shrink_row.rs index aac1109eb..a175aea70 100644 --- a/tests/generated/flex_basis_flex_shrink_row.rs +++ b/tests/generated/flex_basis_flex_shrink_row.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_flex_shrink_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -19,7 +21,7 @@ fn flex_basis_flex_shrink_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -27,6 +29,9 @@ fn flex_basis_flex_shrink_row() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_larger_than_content_column.rs b/tests/generated/flex_basis_larger_than_content_column.rs index 10bf609a4..b6793f23d 100644 --- a/tests/generated/flex_basis_larger_than_content_column.rs +++ b/tests/generated/flex_basis_larger_than_content_column.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_larger_than_content_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn flex_basis_larger_than_content_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -28,13 +30,16 @@ fn flex_basis_larger_than_content_column() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_larger_than_content_row.rs b/tests/generated/flex_basis_larger_than_content_row.rs index 9a1abeda5..11d496e0e 100644 --- a/tests/generated/flex_basis_larger_than_content_row.rs +++ b/tests/generated/flex_basis_larger_than_content_row.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_larger_than_content_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn flex_basis_larger_than_content_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -27,13 +29,16 @@ fn flex_basis_larger_than_content_row() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_overrides_main_size.rs b/tests/generated/flex_basis_overrides_main_size.rs index e2993a256..7ef26d073 100644 --- a/tests/generated/flex_basis_overrides_main_size.rs +++ b/tests/generated/flex_basis_overrides_main_size.rs @@ -1,12 +1,14 @@ #[test] fn flex_basis_overrides_main_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,7 +18,7 @@ fn flex_basis_overrides_main_size() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -26,7 +28,7 @@ fn flex_basis_overrides_main_size() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -38,7 +40,7 @@ fn flex_basis_overrides_main_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,6 +48,9 @@ fn flex_basis_overrides_main_size() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_slightly_smaller_then_content_with_flex_grow_large_size.rs b/tests/generated/flex_basis_slightly_smaller_then_content_with_flex_grow_large_size.rs index 7b07c868e..416d7690d 100644 --- a/tests/generated/flex_basis_slightly_smaller_then_content_with_flex_grow_large_size.rs +++ b/tests/generated/flex_basis_slightly_smaller_then_content_with_flex_grow_large_size.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_slightly_smaller_then_content_with_flex_grow_large_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn flex_basis_slightly_smaller_then_content_with_flex_grow_large_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -31,7 +33,7 @@ fn flex_basis_slightly_smaller_then_content_with_flex_grow_large_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -52,13 +54,16 @@ fn flex_basis_slightly_smaller_then_content_with_flex_grow_large_size() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_smaller_than_content_column.rs b/tests/generated/flex_basis_smaller_than_content_column.rs index 4ffc91b85..32136d204 100644 --- a/tests/generated/flex_basis_smaller_than_content_column.rs +++ b/tests/generated/flex_basis_smaller_than_content_column.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_smaller_than_content_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn flex_basis_smaller_than_content_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -28,13 +30,16 @@ fn flex_basis_smaller_than_content_column() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_smaller_than_content_row.rs b/tests/generated/flex_basis_smaller_than_content_row.rs index 0bfe49c67..844339b79 100644 --- a/tests/generated/flex_basis_smaller_than_content_row.rs +++ b/tests/generated/flex_basis_smaller_than_content_row.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_smaller_than_content_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn flex_basis_smaller_than_content_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -27,13 +29,16 @@ fn flex_basis_smaller_than_content_row() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_smaller_than_main_dimen_column.rs b/tests/generated/flex_basis_smaller_than_main_dimen_column.rs index fb1692acb..e3d7fa95a 100644 --- a/tests/generated/flex_basis_smaller_than_main_dimen_column.rs +++ b/tests/generated/flex_basis_smaller_than_main_dimen_column.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_smaller_than_main_dimen_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn flex_basis_smaller_than_main_dimen_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,13 +21,16 @@ fn flex_basis_smaller_than_main_dimen_column() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 50f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_smaller_than_main_dimen_row.rs b/tests/generated/flex_basis_smaller_than_main_dimen_row.rs index e7afa021e..014774b47 100644 --- a/tests/generated/flex_basis_smaller_than_main_dimen_row.rs +++ b/tests/generated/flex_basis_smaller_than_main_dimen_row.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_smaller_than_main_dimen_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn flex_basis_smaller_than_main_dimen_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -18,13 +20,16 @@ fn flex_basis_smaller_than_main_dimen_row() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 50f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_smaller_then_content_with_flex_grow_large_size.rs b/tests/generated/flex_basis_smaller_then_content_with_flex_grow_large_size.rs index 891791cb7..5a24e3ab3 100644 --- a/tests/generated/flex_basis_smaller_then_content_with_flex_grow_large_size.rs +++ b/tests/generated/flex_basis_smaller_then_content_with_flex_grow_large_size.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_smaller_then_content_with_flex_grow_large_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn flex_basis_smaller_then_content_with_flex_grow_large_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -31,7 +33,7 @@ fn flex_basis_smaller_then_content_with_flex_grow_large_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -52,13 +54,16 @@ fn flex_basis_smaller_then_content_with_flex_grow_large_size() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_smaller_then_content_with_flex_grow_small_size.rs b/tests/generated/flex_basis_smaller_then_content_with_flex_grow_small_size.rs index dc7276739..d3b7fa3ae 100644 --- a/tests/generated/flex_basis_smaller_then_content_with_flex_grow_small_size.rs +++ b/tests/generated/flex_basis_smaller_then_content_with_flex_grow_small_size.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_smaller_then_content_with_flex_grow_small_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn flex_basis_smaller_then_content_with_flex_grow_small_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -31,7 +33,7 @@ fn flex_basis_smaller_then_content_with_flex_grow_small_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -52,13 +54,16 @@ fn flex_basis_smaller_then_content_with_flex_grow_small_size() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 10f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_smaller_then_content_with_flex_grow_unconstraint_size.rs b/tests/generated/flex_basis_smaller_then_content_with_flex_grow_unconstraint_size.rs index 331399ad7..418863b2f 100644 --- a/tests/generated/flex_basis_smaller_then_content_with_flex_grow_unconstraint_size.rs +++ b/tests/generated/flex_basis_smaller_then_content_with_flex_grow_unconstraint_size.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_smaller_then_content_with_flex_grow_unconstraint_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn flex_basis_smaller_then_content_with_flex_grow_unconstraint_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -31,7 +33,7 @@ fn flex_basis_smaller_then_content_with_flex_grow_unconstraint_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -51,6 +53,9 @@ fn flex_basis_smaller_then_content_with_flex_grow_unconstraint_size() { .unwrap(); let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node0, node1]).unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 90f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_smaller_then_content_with_flex_grow_very_large_size.rs b/tests/generated/flex_basis_smaller_then_content_with_flex_grow_very_large_size.rs index 455adf3b7..3c0324588 100644 --- a/tests/generated/flex_basis_smaller_then_content_with_flex_grow_very_large_size.rs +++ b/tests/generated/flex_basis_smaller_then_content_with_flex_grow_very_large_size.rs @@ -1,5 +1,7 @@ #[test] fn flex_basis_smaller_then_content_with_flex_grow_very_large_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn flex_basis_smaller_then_content_with_flex_grow_very_large_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -31,7 +33,7 @@ fn flex_basis_smaller_then_content_with_flex_grow_very_large_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -52,13 +54,16 @@ fn flex_basis_smaller_then_content_with_flex_grow_very_large_size() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_unconstraint_column.rs b/tests/generated/flex_basis_unconstraint_column.rs index 368c91fda..20bc8c775 100644 --- a/tests/generated/flex_basis_unconstraint_column.rs +++ b/tests/generated/flex_basis_unconstraint_column.rs @@ -1,11 +1,13 @@ #[test] fn flex_basis_unconstraint_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -18,6 +20,9 @@ fn flex_basis_unconstraint_column() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 50f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_basis_unconstraint_row.rs b/tests/generated/flex_basis_unconstraint_row.rs index 8aebef00a..5f0fe6e85 100644 --- a/tests/generated/flex_basis_unconstraint_row.rs +++ b/tests/generated/flex_basis_unconstraint_row.rs @@ -1,11 +1,13 @@ #[test] fn flex_basis_unconstraint_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,6 +15,9 @@ fn flex_basis_unconstraint_row() { .unwrap(); let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node0]).unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 0f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_direction_column.rs b/tests/generated/flex_direction_column.rs index c84a50d3c..8831f5d13 100644 --- a/tests/generated/flex_direction_column.rs +++ b/tests/generated/flex_direction_column.rs @@ -1,10 +1,12 @@ #[test] fn flex_direction_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn flex_direction_column() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn flex_direction_column() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ fn flex_direction_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn flex_direction_column() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_direction_column_no_height.rs b/tests/generated/flex_direction_column_no_height.rs index ff0edb7bc..bb6687173 100644 --- a/tests/generated/flex_direction_column_no_height.rs +++ b/tests/generated/flex_direction_column_no_height.rs @@ -1,10 +1,12 @@ #[test] fn flex_direction_column_no_height() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn flex_direction_column_no_height() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn flex_direction_column_no_height() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -32,13 +34,16 @@ fn flex_direction_column_no_height() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 30f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_direction_column_reverse.rs b/tests/generated/flex_direction_column_reverse.rs index 0bd7d7b78..a157b2d96 100644 --- a/tests/generated/flex_direction_column_reverse.rs +++ b/tests/generated/flex_direction_column_reverse.rs @@ -1,10 +1,12 @@ #[test] fn flex_direction_column_reverse() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn flex_direction_column_reverse() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn flex_direction_column_reverse() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ fn flex_direction_column_reverse() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn flex_direction_column_reverse() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_direction_row.rs b/tests/generated/flex_direction_row.rs index 0ea1ef7bc..b7bb3fb18 100644 --- a/tests/generated/flex_direction_row.rs +++ b/tests/generated/flex_direction_row.rs @@ -1,10 +1,12 @@ #[test] fn flex_direction_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn flex_direction_row() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn flex_direction_row() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +36,7 @@ fn flex_direction_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -42,6 +44,9 @@ fn flex_direction_row() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_direction_row_no_width.rs b/tests/generated/flex_direction_row_no_width.rs index 8f39d7bda..f12486a24 100644 --- a/tests/generated/flex_direction_row_no_width.rs +++ b/tests/generated/flex_direction_row_no_width.rs @@ -1,10 +1,12 @@ #[test] fn flex_direction_row_no_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn flex_direction_row_no_width() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn flex_direction_row_no_width() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -31,13 +33,16 @@ fn flex_direction_row_no_width() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 30f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_direction_row_reverse.rs b/tests/generated/flex_direction_row_reverse.rs index 6accc505b..d9540b021 100644 --- a/tests/generated/flex_direction_row_reverse.rs +++ b/tests/generated/flex_direction_row_reverse.rs @@ -1,10 +1,12 @@ #[test] fn flex_direction_row_reverse() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn flex_direction_row_reverse() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn flex_direction_row_reverse() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ fn flex_direction_row_reverse() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn flex_direction_row_reverse() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_grow_child.rs b/tests/generated/flex_grow_child.rs index 0240f803b..ddbeb79cb 100644 --- a/tests/generated/flex_grow_child.rs +++ b/tests/generated/flex_grow_child.rs @@ -1,12 +1,14 @@ #[test] fn flex_grow_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(0f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -14,6 +16,9 @@ fn flex_grow_child() { .unwrap(); let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node0]).unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 0f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_grow_flex_basis_percent_min_max.rs b/tests/generated/flex_grow_flex_basis_percent_min_max.rs index a307e7e56..d3126ee26 100644 --- a/tests/generated/flex_grow_flex_basis_percent_min_max.rs +++ b/tests/generated/flex_grow_flex_basis_percent_min_max.rs @@ -1,5 +1,7 @@ #[test] fn flex_grow_flex_basis_percent_min_max() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,8 +9,8 @@ fn flex_grow_flex_basis_percent_min_max() { flex_grow: 1f32, flex_shrink: 0f32, flex_basis: taffy::style::Dimension::Points(0f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -23,9 +25,9 @@ fn flex_grow_flex_basis_percent_min_max() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, - max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,13 +36,16 @@ fn flex_grow_flex_basis_percent_min_max() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(120f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(120f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 120f32); assert_eq!(taffy.layout(node).unwrap().size.height, 20f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_grow_height_maximized.rs b/tests/generated/flex_grow_height_maximized.rs index bd5a0c0c4..eb384b318 100644 --- a/tests/generated/flex_grow_height_maximized.rs +++ b/tests/generated/flex_grow_height_maximized.rs @@ -1,5 +1,7 @@ #[test] fn flex_grow_height_maximized() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -14,7 +16,7 @@ fn flex_grow_height_maximized() { let node01 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -25,14 +27,8 @@ fn flex_grow_height_maximized() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(500f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(500f32), ..Size::auto() }, ..Default::default() }, &[node00, node01], @@ -45,7 +41,7 @@ fn flex_grow_height_maximized() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -53,6 +49,9 @@ fn flex_grow_height_maximized() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 500f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_grow_in_at_most_container.rs b/tests/generated/flex_grow_in_at_most_container.rs index 53e7e42e0..d75932740 100644 --- a/tests/generated/flex_grow_in_at_most_container.rs +++ b/tests/generated/flex_grow_in_at_most_container.rs @@ -1,5 +1,7 @@ #[test] fn flex_grow_in_at_most_container() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -19,7 +21,7 @@ fn flex_grow_in_at_most_container() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -27,6 +29,9 @@ fn flex_grow_in_at_most_container() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_grow_less_than_factor_one.rs b/tests/generated/flex_grow_less_than_factor_one.rs index a020a35eb..e9a9f1cc4 100644 --- a/tests/generated/flex_grow_less_than_factor_one.rs +++ b/tests/generated/flex_grow_less_than_factor_one.rs @@ -1,5 +1,7 @@ #[test] fn flex_grow_less_than_factor_one() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -24,7 +26,7 @@ fn flex_grow_less_than_factor_one() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -32,6 +34,9 @@ fn flex_grow_less_than_factor_one() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 500f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_grow_root_minimized.rs b/tests/generated/flex_grow_root_minimized.rs index 22e4a4f43..98d71a522 100644 --- a/tests/generated/flex_grow_root_minimized.rs +++ b/tests/generated/flex_grow_root_minimized.rs @@ -1,5 +1,7 @@ #[test] fn flex_grow_root_minimized() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -14,7 +16,7 @@ fn flex_grow_root_minimized() { let node01 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -25,14 +27,8 @@ fn flex_grow_root_minimized() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(500f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(500f32), ..Size::auto() }, ..Default::default() }, &[node00, node01], @@ -42,21 +38,18 @@ fn flex_grow_root_minimized() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(500f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(500f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 300f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_grow_shrink_at_most.rs b/tests/generated/flex_grow_shrink_at_most.rs index 2294090bc..0eb213cbb 100644 --- a/tests/generated/flex_grow_shrink_at_most.rs +++ b/tests/generated/flex_grow_shrink_at_most.rs @@ -1,5 +1,7 @@ #[test] fn flex_grow_shrink_at_most() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children(taffy::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() }, &[]) @@ -11,7 +13,7 @@ fn flex_grow_shrink_at_most() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,6 +21,9 @@ fn flex_grow_shrink_at_most() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_grow_to_min.rs b/tests/generated/flex_grow_to_min.rs index a38cf2c7c..32cd1658b 100644 --- a/tests/generated/flex_grow_to_min.rs +++ b/tests/generated/flex_grow_to_min.rs @@ -1,5 +1,7 @@ #[test] fn flex_grow_to_min() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children(taffy::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() }, &[]) @@ -7,7 +9,7 @@ fn flex_grow_to_min() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -17,21 +19,18 @@ fn flex_grow_to_min() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(500f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(500f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_grow_within_constrained_max_column.rs b/tests/generated/flex_grow_within_constrained_max_column.rs index e07dc4ccf..e4c525b94 100644 --- a/tests/generated/flex_grow_within_constrained_max_column.rs +++ b/tests/generated/flex_grow_within_constrained_max_column.rs @@ -1,5 +1,7 @@ #[test] fn flex_grow_within_constrained_max_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -14,7 +16,7 @@ fn flex_grow_within_constrained_max_column() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -24,17 +26,17 @@ fn flex_grow_within_constrained_max_column() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_grow_within_constrained_max_row.rs b/tests/generated/flex_grow_within_constrained_max_row.rs index b2bf6fdab..caa6383af 100644 --- a/tests/generated/flex_grow_within_constrained_max_row.rs +++ b/tests/generated/flex_grow_within_constrained_max_row.rs @@ -1,5 +1,7 @@ #[test] fn flex_grow_within_constrained_max_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -14,7 +16,7 @@ fn flex_grow_within_constrained_max_row() { let node01 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -23,11 +25,8 @@ fn flex_grow_within_constrained_max_row() { let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node00, node01], @@ -37,13 +36,16 @@ fn flex_grow_within_constrained_max_row() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_grow_within_constrained_max_width.rs b/tests/generated/flex_grow_within_constrained_max_width.rs index e3ae53a44..b10a104e0 100644 --- a/tests/generated/flex_grow_within_constrained_max_width.rs +++ b/tests/generated/flex_grow_within_constrained_max_width.rs @@ -1,11 +1,13 @@ #[test] fn flex_grow_within_constrained_max_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -14,10 +16,7 @@ fn flex_grow_within_constrained_max_width() { let node0 = taffy .new_with_children( taffy::style::Style { - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(300f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(300f32), ..Size::auto() }, ..Default::default() }, &[node00], @@ -30,7 +29,7 @@ fn flex_grow_within_constrained_max_width() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -38,6 +37,9 @@ fn flex_grow_within_constrained_max_width() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_grow_within_constrained_min_column.rs b/tests/generated/flex_grow_within_constrained_min_column.rs index 67d87805e..32c09a9f1 100644 --- a/tests/generated/flex_grow_within_constrained_min_column.rs +++ b/tests/generated/flex_grow_within_constrained_min_column.rs @@ -1,11 +1,13 @@ #[test] fn flex_grow_within_constrained_min_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -15,16 +17,16 @@ fn flex_grow_within_constrained_min_column() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 0f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_grow_within_constrained_min_max_column.rs b/tests/generated/flex_grow_within_constrained_min_max_column.rs index 7fe5a193d..39fc2930a 100644 --- a/tests/generated/flex_grow_within_constrained_min_max_column.rs +++ b/tests/generated/flex_grow_within_constrained_min_max_column.rs @@ -1,11 +1,13 @@ #[test] fn flex_grow_within_constrained_min_max_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -14,16 +16,16 @@ fn flex_grow_within_constrained_min_max_column() { let node = taffy .new_with_children( taffy::style::Style { - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 0f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_grow_within_constrained_min_row.rs b/tests/generated/flex_grow_within_constrained_min_row.rs index fcf497253..cbc72fdc4 100644 --- a/tests/generated/flex_grow_within_constrained_min_row.rs +++ b/tests/generated/flex_grow_within_constrained_min_row.rs @@ -1,11 +1,13 @@ #[test] fn flex_grow_within_constrained_min_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -14,17 +16,17 @@ fn flex_grow_within_constrained_min_row() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_grow_within_max_width.rs b/tests/generated/flex_grow_within_max_width.rs index d3b892060..84cb0d07f 100644 --- a/tests/generated/flex_grow_within_max_width.rs +++ b/tests/generated/flex_grow_within_max_width.rs @@ -1,11 +1,13 @@ #[test] fn flex_grow_within_max_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -14,10 +16,7 @@ fn flex_grow_within_max_width() { let node0 = taffy .new_with_children( taffy::style::Style { - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node00], @@ -30,7 +29,7 @@ fn flex_grow_within_max_width() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -38,6 +37,9 @@ fn flex_grow_within_max_width() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_root_ignored.rs b/tests/generated/flex_root_ignored.rs index 27cdc61ba..7f5c29a32 100644 --- a/tests/generated/flex_root_ignored.rs +++ b/tests/generated/flex_root_ignored.rs @@ -1,5 +1,7 @@ #[test] fn flex_root_ignored() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -14,7 +16,7 @@ fn flex_root_ignored() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -24,21 +26,18 @@ fn flex_root_ignored() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(500f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(500f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 300f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_shrink_by_outer_margin_with_max_size.rs b/tests/generated/flex_shrink_by_outer_margin_with_max_size.rs index 438392f67..fb9b67d26 100644 --- a/tests/generated/flex_shrink_by_outer_margin_with_max_size.rs +++ b/tests/generated/flex_shrink_by_outer_margin_with_max_size.rs @@ -1,5 +1,7 @@ #[test] fn flex_shrink_by_outer_margin_with_max_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,12 @@ fn flex_shrink_by_outer_margin_with_max_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() + }, + margin: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(100f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Points(100f32), ..Default::default() }, ..Default::default() }, &[], @@ -19,17 +24,17 @@ fn flex_shrink_by_outer_margin_with_max_size() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(80f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(80f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 20f32); assert_eq!(taffy.layout(node).unwrap().size.height, 80f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_shrink_flex_grow_child_flex_shrink_other_child.rs b/tests/generated/flex_shrink_flex_grow_child_flex_shrink_other_child.rs index f2f26ab9c..7317a67d1 100644 --- a/tests/generated/flex_shrink_flex_grow_child_flex_shrink_other_child.rs +++ b/tests/generated/flex_shrink_flex_grow_child_flex_shrink_other_child.rs @@ -1,5 +1,7 @@ #[test] fn flex_shrink_flex_grow_child_flex_shrink_other_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -9,7 +11,7 @@ fn flex_shrink_flex_grow_child_flex_shrink_other_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -24,7 +26,7 @@ fn flex_shrink_flex_grow_child_flex_shrink_other_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -37,7 +39,7 @@ fn flex_shrink_flex_grow_child_flex_shrink_other_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,6 +47,9 @@ fn flex_shrink_flex_grow_child_flex_shrink_other_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 500f32); assert_eq!(taffy.layout(node).unwrap().size.height, 500f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_shrink_flex_grow_row.rs b/tests/generated/flex_shrink_flex_grow_row.rs index adcdf52ca..c1dfb37b1 100644 --- a/tests/generated/flex_shrink_flex_grow_row.rs +++ b/tests/generated/flex_shrink_flex_grow_row.rs @@ -1,5 +1,7 @@ #[test] fn flex_shrink_flex_grow_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -9,7 +11,7 @@ fn flex_shrink_flex_grow_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -24,7 +26,7 @@ fn flex_shrink_flex_grow_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -37,7 +39,7 @@ fn flex_shrink_flex_grow_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,6 +47,9 @@ fn flex_shrink_flex_grow_row() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 500f32); assert_eq!(taffy.layout(node).unwrap().size.height, 500f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_shrink_to_zero.rs b/tests/generated/flex_shrink_to_zero.rs index be2a72f10..2f469c26e 100644 --- a/tests/generated/flex_shrink_to_zero.rs +++ b/tests/generated/flex_shrink_to_zero.rs @@ -1,5 +1,7 @@ #[test] fn flex_shrink_to_zero() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn flex_shrink_to_zero() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,7 +24,7 @@ fn flex_shrink_to_zero() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -36,7 +38,7 @@ fn flex_shrink_to_zero() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,13 +48,16 @@ fn flex_shrink_to_zero() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(75f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(75f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 75f32); assert_eq!(taffy.layout(node).unwrap().size.height, 50f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_wrap_align_stretch_fits_one_row.rs b/tests/generated/flex_wrap_align_stretch_fits_one_row.rs index 3916ee095..58f0a1011 100644 --- a/tests/generated/flex_wrap_align_stretch_fits_one_row.rs +++ b/tests/generated/flex_wrap_align_stretch_fits_one_row.rs @@ -1,10 +1,12 @@ #[test] fn flex_wrap_align_stretch_fits_one_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn flex_wrap_align_stretch_fits_one_row() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -26,7 +28,7 @@ fn flex_wrap_align_stretch_fits_one_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(150f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,6 +36,9 @@ fn flex_wrap_align_stretch_fits_one_row() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 150f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_wrap_children_with_min_main_overriding_flex_basis.rs b/tests/generated/flex_wrap_children_with_min_main_overriding_flex_basis.rs index 5a61bdd4a..6bbe35407 100644 --- a/tests/generated/flex_wrap_children_with_min_main_overriding_flex_basis.rs +++ b/tests/generated/flex_wrap_children_with_min_main_overriding_flex_basis.rs @@ -1,12 +1,14 @@ #[test] fn flex_wrap_children_with_min_main_overriding_flex_basis() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(55f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(55f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,8 +18,8 @@ fn flex_wrap_children_with_min_main_overriding_flex_basis() { .new_with_children( taffy::style::Style { flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(55f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(55f32), ..Size::auto() }, ..Default::default() }, &[], @@ -27,13 +29,16 @@ fn flex_wrap_children_with_min_main_overriding_flex_basis() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/flex_wrap_wrap_to_child_height.rs b/tests/generated/flex_wrap_wrap_to_child_height.rs index b496f3c7f..f257cfcea 100644 --- a/tests/generated/flex_wrap_wrap_to_child_height.rs +++ b/tests/generated/flex_wrap_wrap_to_child_height.rs @@ -1,5 +1,7 @@ #[test] fn flex_wrap_wrap_to_child_height() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn flex_wrap_wrap_to_child_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -18,7 +20,7 @@ fn flex_wrap_wrap_to_child_height() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node000], @@ -40,7 +42,7 @@ fn flex_wrap_wrap_to_child_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -54,6 +56,9 @@ fn flex_wrap_wrap_to_child_height() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_child_margins.rs b/tests/generated/gap_column_gap_child_margins.rs index ba1de74d5..92a82958f 100644 --- a/tests/generated/gap_column_gap_child_margins.rs +++ b/tests/generated/gap_column_gap_child_margins.rs @@ -1,5 +1,7 @@ #[test] fn gap_column_gap_child_margins() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,9 +10,9 @@ fn gap_column_gap_child_margins() { flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(2f32), - right: taffy::style::Dimension::Points(2f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(2f32), + right: taffy::style::LengthPercentageAuto::Points(2f32), + ..Rect::zero() }, ..Default::default() }, @@ -24,9 +26,9 @@ fn gap_column_gap_child_margins() { flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -40,9 +42,9 @@ fn gap_column_gap_child_margins() { flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(15f32), - right: taffy::style::Dimension::Points(15f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(15f32), + right: taffy::style::LengthPercentageAuto::Points(15f32), + ..Rect::zero() }, ..Default::default() }, @@ -52,11 +54,11 @@ fn gap_column_gap_child_margins() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -64,6 +66,9 @@ fn gap_column_gap_child_margins() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 80f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_flexible.rs b/tests/generated/gap_column_gap_flexible.rs index 5c6b144ac..b4ad781fd 100644 --- a/tests/generated/gap_column_gap_flexible.rs +++ b/tests/generated/gap_column_gap_flexible.rs @@ -1,5 +1,7 @@ #[test] fn gap_column_gap_flexible() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -38,14 +40,14 @@ fn gap_column_gap_flexible() { .new_with_children( taffy::style::Style { gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -53,6 +55,9 @@ fn gap_column_gap_flexible() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 80f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_flexible_undefined_parent.rs b/tests/generated/gap_column_gap_flexible_undefined_parent.rs index 2ee351b94..56f82c8a3 100644 --- a/tests/generated/gap_column_gap_flexible_undefined_parent.rs +++ b/tests/generated/gap_column_gap_flexible_undefined_parent.rs @@ -1,5 +1,7 @@ #[test] fn gap_column_gap_flexible_undefined_parent() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -38,17 +40,20 @@ fn gap_column_gap_flexible_undefined_parent() { .new_with_children( taffy::style::Style { gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 20f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_inflexible.rs b/tests/generated/gap_column_gap_inflexible.rs index 8a404f670..ddfeb2fb0 100644 --- a/tests/generated/gap_column_gap_inflexible.rs +++ b/tests/generated/gap_column_gap_inflexible.rs @@ -1,10 +1,12 @@ #[test] fn gap_column_gap_inflexible() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn gap_column_gap_inflexible() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn gap_column_gap_inflexible() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -31,11 +33,11 @@ fn gap_column_gap_inflexible() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn gap_column_gap_inflexible() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 80f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_inflexible_undefined_parent.rs b/tests/generated/gap_column_gap_inflexible_undefined_parent.rs index a8ba17947..0acd63a4a 100644 --- a/tests/generated/gap_column_gap_inflexible_undefined_parent.rs +++ b/tests/generated/gap_column_gap_inflexible_undefined_parent.rs @@ -1,10 +1,12 @@ #[test] fn gap_column_gap_inflexible_undefined_parent() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn gap_column_gap_inflexible_undefined_parent() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn gap_column_gap_inflexible_undefined_parent() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -31,14 +33,17 @@ fn gap_column_gap_inflexible_undefined_parent() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 80f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_justify_center.rs b/tests/generated/gap_column_gap_justify_center.rs index 9304b34f7..eb2157acb 100644 --- a/tests/generated/gap_column_gap_justify_center.rs +++ b/tests/generated/gap_column_gap_justify_center.rs @@ -1,10 +1,12 @@ #[test] fn gap_column_gap_justify_center() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn gap_column_gap_justify_center() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn gap_column_gap_justify_center() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -32,11 +34,11 @@ fn gap_column_gap_justify_center() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::Center, - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -44,6 +46,9 @@ fn gap_column_gap_justify_center() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_justify_flex_end.rs b/tests/generated/gap_column_gap_justify_flex_end.rs index cc505c59f..63585f28c 100644 --- a/tests/generated/gap_column_gap_justify_flex_end.rs +++ b/tests/generated/gap_column_gap_justify_flex_end.rs @@ -1,10 +1,12 @@ #[test] fn gap_column_gap_justify_flex_end() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn gap_column_gap_justify_flex_end() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn gap_column_gap_justify_flex_end() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -32,11 +34,11 @@ fn gap_column_gap_justify_flex_end() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::FlexEnd, - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -44,6 +46,9 @@ fn gap_column_gap_justify_flex_end() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_justify_flex_start.rs b/tests/generated/gap_column_gap_justify_flex_start.rs index bf9729d05..57600508c 100644 --- a/tests/generated/gap_column_gap_justify_flex_start.rs +++ b/tests/generated/gap_column_gap_justify_flex_start.rs @@ -1,10 +1,12 @@ #[test] fn gap_column_gap_justify_flex_start() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn gap_column_gap_justify_flex_start() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn gap_column_gap_justify_flex_start() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -31,11 +33,11 @@ fn gap_column_gap_justify_flex_start() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn gap_column_gap_justify_flex_start() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_justify_space_around.rs b/tests/generated/gap_column_gap_justify_space_around.rs index 82f79c5e0..ee40132ea 100644 --- a/tests/generated/gap_column_gap_justify_space_around.rs +++ b/tests/generated/gap_column_gap_justify_space_around.rs @@ -1,10 +1,12 @@ #[test] fn gap_column_gap_justify_space_around() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn gap_column_gap_justify_space_around() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn gap_column_gap_justify_space_around() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -32,11 +34,11 @@ fn gap_column_gap_justify_space_around() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::SpaceAround, - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -44,6 +46,9 @@ fn gap_column_gap_justify_space_around() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_justify_space_between.rs b/tests/generated/gap_column_gap_justify_space_between.rs index 91ae5ce00..b73c3e2ba 100644 --- a/tests/generated/gap_column_gap_justify_space_between.rs +++ b/tests/generated/gap_column_gap_justify_space_between.rs @@ -1,10 +1,12 @@ #[test] fn gap_column_gap_justify_space_between() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn gap_column_gap_justify_space_between() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn gap_column_gap_justify_space_between() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -32,11 +34,11 @@ fn gap_column_gap_justify_space_between() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::SpaceBetween, - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -44,6 +46,9 @@ fn gap_column_gap_justify_space_between() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_justify_space_evenly.rs b/tests/generated/gap_column_gap_justify_space_evenly.rs index 3e9d561de..56a497059 100644 --- a/tests/generated/gap_column_gap_justify_space_evenly.rs +++ b/tests/generated/gap_column_gap_justify_space_evenly.rs @@ -1,10 +1,12 @@ #[test] fn gap_column_gap_justify_space_evenly() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn gap_column_gap_justify_space_evenly() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn gap_column_gap_justify_space_evenly() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -32,11 +34,11 @@ fn gap_column_gap_justify_space_evenly() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::SpaceEvenly, - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -44,6 +46,9 @@ fn gap_column_gap_justify_space_evenly() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_mixed_flexible.rs b/tests/generated/gap_column_gap_mixed_flexible.rs index c28537692..4aa463872 100644 --- a/tests/generated/gap_column_gap_mixed_flexible.rs +++ b/tests/generated/gap_column_gap_mixed_flexible.rs @@ -1,10 +1,12 @@ #[test] fn gap_column_gap_mixed_flexible() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -24,7 +26,7 @@ fn gap_column_gap_mixed_flexible() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -33,11 +35,11 @@ fn gap_column_gap_mixed_flexible() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,6 +47,9 @@ fn gap_column_gap_mixed_flexible() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 80f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_percentage_cyclic_partially_shrinkable.rs b/tests/generated/gap_column_gap_percentage_cyclic_partially_shrinkable.rs index 1297a5869..19ea2f646 100644 --- a/tests/generated/gap_column_gap_percentage_cyclic_partially_shrinkable.rs +++ b/tests/generated/gap_column_gap_percentage_cyclic_partially_shrinkable.rs @@ -1,5 +1,7 @@ #[test] fn gap_column_gap_percentage_cyclic_partially_shrinkable() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn gap_column_gap_percentage_cyclic_partially_shrinkable() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ fn gap_column_gap_percentage_cyclic_partially_shrinkable() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -35,7 +37,7 @@ fn gap_column_gap_percentage_cyclic_partially_shrinkable() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -45,13 +47,16 @@ fn gap_column_gap_percentage_cyclic_partially_shrinkable() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.5f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Percent(0.5f32), ..Size::zero() }, ..Default::default() }, &[node0, node1, node2], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 60f32); assert_eq!(taffy.layout(node).unwrap().size.height, 40f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_percentage_cyclic_shrinkable.rs b/tests/generated/gap_column_gap_percentage_cyclic_shrinkable.rs index 1a87ebc85..0234a9c95 100644 --- a/tests/generated/gap_column_gap_percentage_cyclic_shrinkable.rs +++ b/tests/generated/gap_column_gap_percentage_cyclic_shrinkable.rs @@ -1,5 +1,7 @@ #[test] fn gap_column_gap_percentage_cyclic_shrinkable() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn gap_column_gap_percentage_cyclic_shrinkable() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn gap_column_gap_percentage_cyclic_shrinkable() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn gap_column_gap_percentage_cyclic_shrinkable() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,13 +45,16 @@ fn gap_column_gap_percentage_cyclic_shrinkable() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Percent(0.2f32), ..Size::zero() }, ..Default::default() }, &[node0, node1, node2], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 60f32); assert_eq!(taffy.layout(node).unwrap().size.height, 40f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_percentage_cyclic_unshrinkable.rs b/tests/generated/gap_column_gap_percentage_cyclic_unshrinkable.rs index 62fcdceee..bb13f6fd8 100644 --- a/tests/generated/gap_column_gap_percentage_cyclic_unshrinkable.rs +++ b/tests/generated/gap_column_gap_percentage_cyclic_unshrinkable.rs @@ -1,5 +1,7 @@ #[test] fn gap_column_gap_percentage_cyclic_unshrinkable() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn gap_column_gap_percentage_cyclic_unshrinkable() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,7 +24,7 @@ fn gap_column_gap_percentage_cyclic_unshrinkable() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -36,7 +38,7 @@ fn gap_column_gap_percentage_cyclic_unshrinkable() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,13 +48,16 @@ fn gap_column_gap_percentage_cyclic_unshrinkable() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Percent(0.2f32), ..Size::zero() }, ..Default::default() }, &[node0, node1, node2], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 60f32); assert_eq!(taffy.layout(node).unwrap().size.height, 40f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_percentage_flexible.rs b/tests/generated/gap_column_gap_percentage_flexible.rs index db34d50e3..b906fd0a7 100644 --- a/tests/generated/gap_column_gap_percentage_flexible.rs +++ b/tests/generated/gap_column_gap_percentage_flexible.rs @@ -1,5 +1,7 @@ #[test] fn gap_column_gap_percentage_flexible() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -38,14 +40,14 @@ fn gap_column_gap_percentage_flexible() { .new_with_children( taffy::style::Style { gap: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.1f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Percent(0.1f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -53,6 +55,9 @@ fn gap_column_gap_percentage_flexible() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_percentage_inflexible.rs b/tests/generated/gap_column_gap_percentage_inflexible.rs index 8d2c64181..b22e8c4f3 100644 --- a/tests/generated/gap_column_gap_percentage_inflexible.rs +++ b/tests/generated/gap_column_gap_percentage_inflexible.rs @@ -1,10 +1,12 @@ #[test] fn gap_column_gap_percentage_inflexible() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn gap_column_gap_percentage_inflexible() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn gap_column_gap_percentage_inflexible() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -31,11 +33,11 @@ fn gap_column_gap_percentage_inflexible() { let node = taffy .new_with_children( taffy::style::Style { - gap: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Percent(0.2f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn gap_column_gap_percentage_inflexible() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_wrap_align_center.rs b/tests/generated/gap_column_gap_wrap_align_center.rs index d83fa4a5f..e8d43d75c 100644 --- a/tests/generated/gap_column_gap_wrap_align_center.rs +++ b/tests/generated/gap_column_gap_wrap_align_center.rs @@ -1,5 +1,7 @@ #[test] fn gap_column_gap_wrap_align_center() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn gap_column_gap_wrap_align_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn gap_column_gap_wrap_align_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn gap_column_gap_wrap_align_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn gap_column_gap_wrap_align_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn gap_column_gap_wrap_align_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -72,7 +74,7 @@ fn gap_column_gap_wrap_align_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -85,14 +87,14 @@ fn gap_column_gap_wrap_align_center() { flex_wrap: taffy::style::FlexWrap::Wrap, align_content: taffy::style::AlignContent::Center, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -100,6 +102,9 @@ fn gap_column_gap_wrap_align_center() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_wrap_align_flex_end.rs b/tests/generated/gap_column_gap_wrap_align_flex_end.rs index 89eccd8de..b43ebe8e4 100644 --- a/tests/generated/gap_column_gap_wrap_align_flex_end.rs +++ b/tests/generated/gap_column_gap_wrap_align_flex_end.rs @@ -1,5 +1,7 @@ #[test] fn gap_column_gap_wrap_align_flex_end() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn gap_column_gap_wrap_align_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn gap_column_gap_wrap_align_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn gap_column_gap_wrap_align_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn gap_column_gap_wrap_align_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn gap_column_gap_wrap_align_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -72,7 +74,7 @@ fn gap_column_gap_wrap_align_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -85,14 +87,14 @@ fn gap_column_gap_wrap_align_flex_end() { flex_wrap: taffy::style::FlexWrap::Wrap, align_content: taffy::style::AlignContent::FlexEnd, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -100,6 +102,9 @@ fn gap_column_gap_wrap_align_flex_end() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_wrap_align_flex_start.rs b/tests/generated/gap_column_gap_wrap_align_flex_start.rs index ad2ea92d0..2a314b3b3 100644 --- a/tests/generated/gap_column_gap_wrap_align_flex_start.rs +++ b/tests/generated/gap_column_gap_wrap_align_flex_start.rs @@ -1,5 +1,7 @@ #[test] fn gap_column_gap_wrap_align_flex_start() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn gap_column_gap_wrap_align_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn gap_column_gap_wrap_align_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn gap_column_gap_wrap_align_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn gap_column_gap_wrap_align_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn gap_column_gap_wrap_align_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -72,7 +74,7 @@ fn gap_column_gap_wrap_align_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -85,14 +87,14 @@ fn gap_column_gap_wrap_align_flex_start() { flex_wrap: taffy::style::FlexWrap::Wrap, align_content: taffy::style::AlignContent::FlexStart, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -100,6 +102,9 @@ fn gap_column_gap_wrap_align_flex_start() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_wrap_align_space_around.rs b/tests/generated/gap_column_gap_wrap_align_space_around.rs index 55a58bbeb..028a0bb09 100644 --- a/tests/generated/gap_column_gap_wrap_align_space_around.rs +++ b/tests/generated/gap_column_gap_wrap_align_space_around.rs @@ -1,5 +1,7 @@ #[test] fn gap_column_gap_wrap_align_space_around() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn gap_column_gap_wrap_align_space_around() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn gap_column_gap_wrap_align_space_around() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn gap_column_gap_wrap_align_space_around() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn gap_column_gap_wrap_align_space_around() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn gap_column_gap_wrap_align_space_around() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -72,7 +74,7 @@ fn gap_column_gap_wrap_align_space_around() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -85,14 +87,14 @@ fn gap_column_gap_wrap_align_space_around() { flex_wrap: taffy::style::FlexWrap::Wrap, align_content: taffy::style::AlignContent::SpaceAround, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -100,6 +102,9 @@ fn gap_column_gap_wrap_align_space_around() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_wrap_align_space_between.rs b/tests/generated/gap_column_gap_wrap_align_space_between.rs index 2f354473a..4b9ded62b 100644 --- a/tests/generated/gap_column_gap_wrap_align_space_between.rs +++ b/tests/generated/gap_column_gap_wrap_align_space_between.rs @@ -1,5 +1,7 @@ #[test] fn gap_column_gap_wrap_align_space_between() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn gap_column_gap_wrap_align_space_between() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn gap_column_gap_wrap_align_space_between() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn gap_column_gap_wrap_align_space_between() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn gap_column_gap_wrap_align_space_between() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn gap_column_gap_wrap_align_space_between() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -72,7 +74,7 @@ fn gap_column_gap_wrap_align_space_between() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -85,14 +87,14 @@ fn gap_column_gap_wrap_align_space_between() { flex_wrap: taffy::style::FlexWrap::Wrap, align_content: taffy::style::AlignContent::SpaceBetween, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -100,6 +102,9 @@ fn gap_column_gap_wrap_align_space_between() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_gap_wrap_align_stretch.rs b/tests/generated/gap_column_gap_wrap_align_stretch.rs index be1b3ca9c..51e2c4edb 100644 --- a/tests/generated/gap_column_gap_wrap_align_stretch.rs +++ b/tests/generated/gap_column_gap_wrap_align_stretch.rs @@ -1,11 +1,13 @@ #[test] fn gap_column_gap_wrap_align_stretch() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -15,7 +17,7 @@ fn gap_column_gap_wrap_align_stretch() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -25,7 +27,7 @@ fn gap_column_gap_wrap_align_stretch() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ fn gap_column_gap_wrap_align_stretch() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -45,7 +47,7 @@ fn gap_column_gap_wrap_align_stretch() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -55,11 +57,11 @@ fn gap_column_gap_wrap_align_stretch() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, - gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(5f32), ..Default::default() }, + gap: taffy::geometry::Size { width: taffy::style::LengthPercentage::Points(5f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(300f32), height: taffy::style::Dimension::Points(300f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -67,6 +69,9 @@ fn gap_column_gap_wrap_align_stretch() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 300f32); assert_eq!(taffy.layout(node).unwrap().size.height, 300f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_column_row_gap_wrapping.rs b/tests/generated/gap_column_row_gap_wrapping.rs index 35293ce61..5ea5c6dad 100644 --- a/tests/generated/gap_column_row_gap_wrapping.rs +++ b/tests/generated/gap_column_row_gap_wrapping.rs @@ -1,5 +1,7 @@ #[test] fn gap_column_row_gap_wrapping() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn gap_column_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn gap_column_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn gap_column_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn gap_column_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn gap_column_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -72,7 +74,7 @@ fn gap_column_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -85,7 +87,7 @@ fn gap_column_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -98,7 +100,7 @@ fn gap_column_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -111,7 +113,7 @@ fn gap_column_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -123,17 +125,20 @@ fn gap_column_row_gap_wrapping() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3, node4, node5, node6, node7, node8], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 80f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_percentage_row_gap_wrapping.rs b/tests/generated/gap_percentage_row_gap_wrapping.rs index 954f7e107..eedaa1a58 100644 --- a/tests/generated/gap_percentage_row_gap_wrapping.rs +++ b/tests/generated/gap_percentage_row_gap_wrapping.rs @@ -1,5 +1,7 @@ #[test] fn gap_percentage_row_gap_wrapping() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn gap_percentage_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn gap_percentage_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn gap_percentage_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn gap_percentage_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn gap_percentage_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -72,7 +74,7 @@ fn gap_percentage_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -85,7 +87,7 @@ fn gap_percentage_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -98,7 +100,7 @@ fn gap_percentage_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -111,7 +113,7 @@ fn gap_percentage_row_gap_wrapping() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -123,17 +125,20 @@ fn gap_percentage_row_gap_wrapping() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Percent(0.1f32), + ..Size::zero() }, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3, node4, node5, node6, node7, node8], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 80f32); assert_eq!(taffy.layout(node).unwrap().size.height, 60f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_row_gap_align_items_end.rs b/tests/generated/gap_row_gap_align_items_end.rs index af22edb55..6da74dcd3 100644 --- a/tests/generated/gap_row_gap_align_items_end.rs +++ b/tests/generated/gap_row_gap_align_items_end.rs @@ -1,10 +1,12 @@ #[test] fn gap_row_gap_align_items_end() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn gap_row_gap_align_items_end() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn gap_row_gap_align_items_end() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -31,7 +33,7 @@ fn gap_row_gap_align_items_end() { let node3 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -40,7 +42,7 @@ fn gap_row_gap_align_items_end() { let node4 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -49,7 +51,7 @@ fn gap_row_gap_align_items_end() { let node5 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -61,14 +63,14 @@ fn gap_row_gap_align_items_end() { flex_wrap: taffy::style::FlexWrap::Wrap, align_items: taffy::style::AlignItems::FlexEnd, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -76,6 +78,9 @@ fn gap_row_gap_align_items_end() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_row_gap_align_items_stretch.rs b/tests/generated/gap_row_gap_align_items_stretch.rs index b0c16545f..ef7720780 100644 --- a/tests/generated/gap_row_gap_align_items_stretch.rs +++ b/tests/generated/gap_row_gap_align_items_stretch.rs @@ -1,10 +1,12 @@ #[test] fn gap_row_gap_align_items_stretch() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn gap_row_gap_align_items_stretch() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn gap_row_gap_align_items_stretch() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -31,7 +33,7 @@ fn gap_row_gap_align_items_stretch() { let node3 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -40,7 +42,7 @@ fn gap_row_gap_align_items_stretch() { let node4 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -49,7 +51,7 @@ fn gap_row_gap_align_items_stretch() { let node5 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -60,14 +62,14 @@ fn gap_row_gap_align_items_stretch() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, gap: taffy::geometry::Size { - width: taffy::style::Dimension::Points(10f32), - height: taffy::style::Dimension::Points(20f32), - ..Default::default() + width: taffy::style::LengthPercentage::Points(10f32), + height: taffy::style::LengthPercentage::Points(20f32), + ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -75,6 +77,9 @@ fn gap_row_gap_align_items_stretch() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_row_gap_column_child_margins.rs b/tests/generated/gap_row_gap_column_child_margins.rs index 16df50694..88248f325 100644 --- a/tests/generated/gap_row_gap_column_child_margins.rs +++ b/tests/generated/gap_row_gap_column_child_margins.rs @@ -1,5 +1,7 @@ #[test] fn gap_row_gap_column_child_margins() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,9 +10,9 @@ fn gap_row_gap_column_child_margins() { flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(2f32), - bottom: taffy::style::Dimension::Points(2f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(2f32), + bottom: taffy::style::LengthPercentageAuto::Points(2f32), + ..Rect::zero() }, ..Default::default() }, @@ -24,9 +26,9 @@ fn gap_row_gap_column_child_margins() { flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -40,9 +42,9 @@ fn gap_row_gap_column_child_margins() { flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(15f32), - bottom: taffy::style::Dimension::Points(15f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(15f32), + bottom: taffy::style::LengthPercentageAuto::Points(15f32), + ..Rect::zero() }, ..Default::default() }, @@ -53,11 +55,11 @@ fn gap_row_gap_column_child_margins() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - gap: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { height: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -65,6 +67,9 @@ fn gap_row_gap_column_child_margins() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/gap_row_gap_row_wrap_child_margins.rs b/tests/generated/gap_row_gap_row_wrap_child_margins.rs index 34363cd26..27e7ef879 100644 --- a/tests/generated/gap_row_gap_row_wrap_child_margins.rs +++ b/tests/generated/gap_row_gap_row_wrap_child_margins.rs @@ -1,14 +1,16 @@ #[test] fn gap_row_gap_row_wrap_child_margins() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(2f32), - bottom: taffy::style::Dimension::Points(2f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(2f32), + bottom: taffy::style::LengthPercentageAuto::Points(2f32), + ..Rect::zero() }, ..Default::default() }, @@ -18,11 +20,11 @@ fn gap_row_gap_row_wrap_child_margins() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -32,11 +34,11 @@ fn gap_row_gap_row_wrap_child_margins() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(15f32), - bottom: taffy::style::Dimension::Points(15f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(15f32), + bottom: taffy::style::LengthPercentageAuto::Points(15f32), + ..Rect::zero() }, ..Default::default() }, @@ -47,11 +49,11 @@ fn gap_row_gap_row_wrap_child_margins() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, - gap: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + gap: taffy::geometry::Size { height: taffy::style::LengthPercentage::Points(10f32), ..Size::zero() }, size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,6 +61,9 @@ fn gap_row_gap_row_wrap_child_margins() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_column_center.rs b/tests/generated/justify_content_column_center.rs index 7b883f0f3..771f0b854 100644 --- a/tests/generated/justify_content_column_center.rs +++ b/tests/generated/justify_content_column_center.rs @@ -1,10 +1,12 @@ #[test] fn justify_content_column_center() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn justify_content_column_center() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn justify_content_column_center() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -36,7 +38,7 @@ fn justify_content_column_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -44,6 +46,9 @@ fn justify_content_column_center() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_column_flex_end.rs b/tests/generated/justify_content_column_flex_end.rs index b3cc9be34..ab66c0281 100644 --- a/tests/generated/justify_content_column_flex_end.rs +++ b/tests/generated/justify_content_column_flex_end.rs @@ -1,10 +1,12 @@ #[test] fn justify_content_column_flex_end() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn justify_content_column_flex_end() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn justify_content_column_flex_end() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -36,7 +38,7 @@ fn justify_content_column_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -44,6 +46,9 @@ fn justify_content_column_flex_end() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_column_flex_start.rs b/tests/generated/justify_content_column_flex_start.rs index 3b132c8b7..d8d870bb9 100644 --- a/tests/generated/justify_content_column_flex_start.rs +++ b/tests/generated/justify_content_column_flex_start.rs @@ -1,10 +1,12 @@ #[test] fn justify_content_column_flex_start() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn justify_content_column_flex_start() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn justify_content_column_flex_start() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ fn justify_content_column_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn justify_content_column_flex_start() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_column_min_height_and_margin_bottom.rs b/tests/generated/justify_content_column_min_height_and_margin_bottom.rs index 4830d330a..d9ed1ab2b 100644 --- a/tests/generated/justify_content_column_min_height_and_margin_bottom.rs +++ b/tests/generated/justify_content_column_min_height_and_margin_bottom.rs @@ -1,5 +1,7 @@ #[test] fn justify_content_column_min_height_and_margin_bottom() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,12 @@ fn justify_content_column_min_height_and_margin_bottom() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() + }, + margin: taffy::geometry::Rect { + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { bottom: taffy::style::Dimension::Points(10f32), ..Default::default() }, ..Default::default() }, &[], @@ -20,16 +25,16 @@ fn justify_content_column_min_height_and_margin_bottom() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, justify_content: taffy::style::JustifyContent::Center, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(50f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 20f32); assert_eq!(taffy.layout(node).unwrap().size.height, 50f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_column_min_height_and_margin_top.rs b/tests/generated/justify_content_column_min_height_and_margin_top.rs index 421918b97..43a998d3a 100644 --- a/tests/generated/justify_content_column_min_height_and_margin_top.rs +++ b/tests/generated/justify_content_column_min_height_and_margin_top.rs @@ -1,5 +1,7 @@ #[test] fn justify_content_column_min_height_and_margin_top() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,12 @@ fn justify_content_column_min_height_and_margin_top() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() + }, + margin: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Points(10f32), ..Default::default() }, ..Default::default() }, &[], @@ -20,16 +25,16 @@ fn justify_content_column_min_height_and_margin_top() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, justify_content: taffy::style::JustifyContent::Center, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(50f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 20f32); assert_eq!(taffy.layout(node).unwrap().size.height, 50f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_column_space_around.rs b/tests/generated/justify_content_column_space_around.rs index 2089bd38d..95e90f7ce 100644 --- a/tests/generated/justify_content_column_space_around.rs +++ b/tests/generated/justify_content_column_space_around.rs @@ -1,10 +1,12 @@ #[test] fn justify_content_column_space_around() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn justify_content_column_space_around() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn justify_content_column_space_around() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -36,7 +38,7 @@ fn justify_content_column_space_around() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -44,6 +46,9 @@ fn justify_content_column_space_around() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_column_space_between.rs b/tests/generated/justify_content_column_space_between.rs index abea126ea..a68e236a2 100644 --- a/tests/generated/justify_content_column_space_between.rs +++ b/tests/generated/justify_content_column_space_between.rs @@ -1,10 +1,12 @@ #[test] fn justify_content_column_space_between() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn justify_content_column_space_between() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn justify_content_column_space_between() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -36,7 +38,7 @@ fn justify_content_column_space_between() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -44,6 +46,9 @@ fn justify_content_column_space_between() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_column_space_evenly.rs b/tests/generated/justify_content_column_space_evenly.rs index 34f4f447a..5fc73fdc9 100644 --- a/tests/generated/justify_content_column_space_evenly.rs +++ b/tests/generated/justify_content_column_space_evenly.rs @@ -1,10 +1,12 @@ #[test] fn justify_content_column_space_evenly() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn justify_content_column_space_evenly() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn justify_content_column_space_evenly() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -36,7 +38,7 @@ fn justify_content_column_space_evenly() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -44,6 +46,9 @@ fn justify_content_column_space_evenly() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_min_max.rs b/tests/generated/justify_content_min_max.rs index 187b67119..e01a5558e 100644 --- a/tests/generated/justify_content_min_max.rs +++ b/tests/generated/justify_content_min_max.rs @@ -1,5 +1,7 @@ #[test] fn justify_content_min_max() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn justify_content_min_max() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(60f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,21 +21,18 @@ fn justify_content_min_max() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, justify_content: taffy::style::JustifyContent::Center, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(200f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_min_width_with_padding_child_width_greater_than_parent.rs b/tests/generated/justify_content_min_width_with_padding_child_width_greater_than_parent.rs index 2912f6b79..2974b9cc7 100644 --- a/tests/generated/justify_content_min_width_with_padding_child_width_greater_than_parent.rs +++ b/tests/generated/justify_content_min_width_with_padding_child_width_greater_than_parent.rs @@ -1,5 +1,7 @@ #[test] fn justify_content_min_width_with_padding_child_width_greater_than_parent() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn justify_content_min_width_with_padding_child_width_greater_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(300f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -18,14 +20,11 @@ fn justify_content_min_width_with_padding_child_width_greater_than_parent() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::Center, - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(400f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(400f32), ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(100f32), - right: taffy::style::Dimension::Points(100f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(100f32), + right: taffy::style::LengthPercentage::Points(100f32), + ..Rect::zero() }, ..Default::default() }, @@ -40,7 +39,7 @@ fn justify_content_min_width_with_padding_child_width_greater_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(1000f32), height: taffy::style::Dimension::Points(1584f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -48,6 +47,9 @@ fn justify_content_min_width_with_padding_child_width_greater_than_parent() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 1000f32); assert_eq!(taffy.layout(node).unwrap().size.height, 1584f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_min_width_with_padding_child_width_lower_than_parent.rs b/tests/generated/justify_content_min_width_with_padding_child_width_lower_than_parent.rs index ae698b6b1..6464f05ed 100644 --- a/tests/generated/justify_content_min_width_with_padding_child_width_lower_than_parent.rs +++ b/tests/generated/justify_content_min_width_with_padding_child_width_lower_than_parent.rs @@ -1,5 +1,7 @@ #[test] fn justify_content_min_width_with_padding_child_width_lower_than_parent() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn justify_content_min_width_with_padding_child_width_lower_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(199f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -18,14 +20,11 @@ fn justify_content_min_width_with_padding_child_width_lower_than_parent() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::Center, - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(400f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(400f32), ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(100f32), - right: taffy::style::Dimension::Points(100f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(100f32), + right: taffy::style::LengthPercentage::Points(100f32), + ..Rect::zero() }, ..Default::default() }, @@ -40,7 +39,7 @@ fn justify_content_min_width_with_padding_child_width_lower_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(1080f32), height: taffy::style::Dimension::Points(1584f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -48,6 +47,9 @@ fn justify_content_min_width_with_padding_child_width_lower_than_parent() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 1080f32); assert_eq!(taffy.layout(node).unwrap().size.height, 1584f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_overflow_min_max.rs b/tests/generated/justify_content_overflow_min_max.rs index e98a59729..791150708 100644 --- a/tests/generated/justify_content_overflow_min_max.rs +++ b/tests/generated/justify_content_overflow_min_max.rs @@ -1,5 +1,7 @@ #[test] fn justify_content_overflow_min_max() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,7 +10,7 @@ fn justify_content_overflow_min_max() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,7 +24,7 @@ fn justify_content_overflow_min_max() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -36,7 +38,7 @@ fn justify_content_overflow_min_max() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -48,20 +50,17 @@ fn justify_content_overflow_min_max() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, justify_content: taffy::style::JustifyContent::Center, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(110f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(110f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 50f32); assert_eq!(taffy.layout(node).unwrap().size.height, 110f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_row_center.rs b/tests/generated/justify_content_row_center.rs index 59b98b05f..29d9c3452 100644 --- a/tests/generated/justify_content_row_center.rs +++ b/tests/generated/justify_content_row_center.rs @@ -1,10 +1,12 @@ #[test] fn justify_content_row_center() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn justify_content_row_center() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn justify_content_row_center() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ fn justify_content_row_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn justify_content_row_center() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_row_flex_end.rs b/tests/generated/justify_content_row_flex_end.rs index cf4b1fd32..6487cf310 100644 --- a/tests/generated/justify_content_row_flex_end.rs +++ b/tests/generated/justify_content_row_flex_end.rs @@ -1,10 +1,12 @@ #[test] fn justify_content_row_flex_end() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn justify_content_row_flex_end() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn justify_content_row_flex_end() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ fn justify_content_row_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn justify_content_row_flex_end() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_row_flex_start.rs b/tests/generated/justify_content_row_flex_start.rs index 68dad366a..bea5d0552 100644 --- a/tests/generated/justify_content_row_flex_start.rs +++ b/tests/generated/justify_content_row_flex_start.rs @@ -1,10 +1,12 @@ #[test] fn justify_content_row_flex_start() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn justify_content_row_flex_start() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn justify_content_row_flex_start() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +36,7 @@ fn justify_content_row_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -42,6 +44,9 @@ fn justify_content_row_flex_start() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_row_max_width_and_margin.rs b/tests/generated/justify_content_row_max_width_and_margin.rs index 2b1ce60e9..12e97b8c0 100644 --- a/tests/generated/justify_content_row_max_width_and_margin.rs +++ b/tests/generated/justify_content_row_max_width_and_margin.rs @@ -1,5 +1,7 @@ #[test] fn justify_content_row_max_width_and_margin() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,12 @@ fn justify_content_row_max_width_and_margin() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() + }, + margin: taffy::geometry::Rect { + left: taffy::style::LengthPercentageAuto::Points(100f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { left: taffy::style::Dimension::Points(100f32), ..Default::default() }, ..Default::default() }, &[], @@ -19,14 +24,17 @@ fn justify_content_row_max_width_and_margin() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::Center, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, - max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 80f32); assert_eq!(taffy.layout(node).unwrap().size.height, 20f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_row_min_width_and_margin.rs b/tests/generated/justify_content_row_min_width_and_margin.rs index af0eeacdf..74dc8811f 100644 --- a/tests/generated/justify_content_row_min_width_and_margin.rs +++ b/tests/generated/justify_content_row_min_width_and_margin.rs @@ -1,5 +1,7 @@ #[test] fn justify_content_row_min_width_and_margin() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,12 @@ fn justify_content_row_min_width_and_margin() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() + }, + margin: taffy::geometry::Rect { + left: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { left: taffy::style::Dimension::Points(10f32), ..Default::default() }, ..Default::default() }, &[], @@ -19,13 +24,16 @@ fn justify_content_row_min_width_and_margin() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::Center, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 50f32); assert_eq!(taffy.layout(node).unwrap().size.height, 20f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_row_space_around.rs b/tests/generated/justify_content_row_space_around.rs index ae8786d3a..d016f88c8 100644 --- a/tests/generated/justify_content_row_space_around.rs +++ b/tests/generated/justify_content_row_space_around.rs @@ -1,10 +1,12 @@ #[test] fn justify_content_row_space_around() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn justify_content_row_space_around() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn justify_content_row_space_around() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ fn justify_content_row_space_around() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn justify_content_row_space_around() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_row_space_between.rs b/tests/generated/justify_content_row_space_between.rs index 0f1e0647d..1aab054f9 100644 --- a/tests/generated/justify_content_row_space_between.rs +++ b/tests/generated/justify_content_row_space_between.rs @@ -1,10 +1,12 @@ #[test] fn justify_content_row_space_between() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn justify_content_row_space_between() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn justify_content_row_space_between() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ fn justify_content_row_space_between() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn justify_content_row_space_between() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/justify_content_row_space_evenly.rs b/tests/generated/justify_content_row_space_evenly.rs index 505bdeb5f..754b26c5d 100644 --- a/tests/generated/justify_content_row_space_evenly.rs +++ b/tests/generated/justify_content_row_space_evenly.rs @@ -1,10 +1,12 @@ #[test] fn justify_content_row_space_evenly() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn justify_content_row_space_evenly() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn justify_content_row_space_evenly() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ fn justify_content_row_space_evenly() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn justify_content_row_space_evenly() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_and_flex_column.rs b/tests/generated/margin_and_flex_column.rs index f4f04c736..df1108975 100644 --- a/tests/generated/margin_and_flex_column.rs +++ b/tests/generated/margin_and_flex_column.rs @@ -1,14 +1,16 @@ #[test] fn margin_and_flex_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -22,7 +24,7 @@ fn margin_and_flex_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,6 +32,9 @@ fn margin_and_flex_column() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_and_flex_row.rs b/tests/generated/margin_and_flex_row.rs index 77e21bc43..25e904c86 100644 --- a/tests/generated/margin_and_flex_row.rs +++ b/tests/generated/margin_and_flex_row.rs @@ -1,14 +1,16 @@ #[test] fn margin_and_flex_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -21,7 +23,7 @@ fn margin_and_flex_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -29,6 +31,9 @@ fn margin_and_flex_row() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_and_stretch_column.rs b/tests/generated/margin_and_stretch_column.rs index a753e3a89..27e3ec6fd 100644 --- a/tests/generated/margin_and_stretch_column.rs +++ b/tests/generated/margin_and_stretch_column.rs @@ -1,14 +1,16 @@ #[test] fn margin_and_stretch_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -22,7 +24,7 @@ fn margin_and_stretch_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,6 +32,9 @@ fn margin_and_stretch_column() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_and_stretch_row.rs b/tests/generated/margin_and_stretch_row.rs index 45f089b25..3ce6f79a9 100644 --- a/tests/generated/margin_and_stretch_row.rs +++ b/tests/generated/margin_and_stretch_row.rs @@ -1,14 +1,16 @@ #[test] fn margin_and_stretch_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + top: taffy::style::LengthPercentageAuto::Points(10f32), + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -21,7 +23,7 @@ fn margin_and_stretch_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -29,6 +31,9 @@ fn margin_and_stretch_row() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_bottom.rs b/tests/generated/margin_auto_bottom.rs index 673dc957c..4d5310d78 100644 --- a/tests/generated/margin_auto_bottom.rs +++ b/tests/generated/margin_auto_bottom.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_bottom() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,9 @@ fn margin_auto_bottom() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { bottom: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { bottom: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ fn margin_auto_bottom() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -35,7 +37,7 @@ fn margin_auto_bottom() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn margin_auto_bottom() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_bottom_and_top.rs b/tests/generated/margin_auto_bottom_and_top.rs index e407838b1..1e0973e3d 100644 --- a/tests/generated/margin_auto_bottom_and_top.rs +++ b/tests/generated/margin_auto_bottom_and_top.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_bottom_and_top() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ fn margin_auto_bottom_and_top() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Auto, - bottom: taffy::style::Dimension::Auto, - ..Default::default() + top: taffy::style::LengthPercentageAuto::Auto, + bottom: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -25,7 +27,7 @@ fn margin_auto_bottom_and_top() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -39,7 +41,7 @@ fn margin_auto_bottom_and_top() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -47,6 +49,9 @@ fn margin_auto_bottom_and_top() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_bottom_and_top_justify_center.rs b/tests/generated/margin_auto_bottom_and_top_justify_center.rs index 507dd0410..2e1331d66 100644 --- a/tests/generated/margin_auto_bottom_and_top_justify_center.rs +++ b/tests/generated/margin_auto_bottom_and_top_justify_center.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_bottom_and_top_justify_center() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ fn margin_auto_bottom_and_top_justify_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Auto, - bottom: taffy::style::Dimension::Auto, - ..Default::default() + top: taffy::style::LengthPercentageAuto::Auto, + bottom: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -25,7 +27,7 @@ fn margin_auto_bottom_and_top_justify_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -39,7 +41,7 @@ fn margin_auto_bottom_and_top_justify_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -47,6 +49,9 @@ fn margin_auto_bottom_and_top_justify_center() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_left.rs b/tests/generated/margin_auto_left.rs index 0a284fdfb..b05f840e9 100644 --- a/tests/generated/margin_auto_left.rs +++ b/tests/generated/margin_auto_left.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_left() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,9 @@ fn margin_auto_left() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { left: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { left: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ fn margin_auto_left() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -35,7 +37,7 @@ fn margin_auto_left() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn margin_auto_left() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_left_and_right.rs b/tests/generated/margin_auto_left_and_right.rs index 2c9298a29..340ff5a19 100644 --- a/tests/generated/margin_auto_left_and_right.rs +++ b/tests/generated/margin_auto_left_and_right.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_left_and_right() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ fn margin_auto_left_and_right() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Auto, - right: taffy::style::Dimension::Auto, - ..Default::default() + left: taffy::style::LengthPercentageAuto::Auto, + right: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -25,7 +27,7 @@ fn margin_auto_left_and_right() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -38,7 +40,7 @@ fn margin_auto_left_and_right() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,6 +48,9 @@ fn margin_auto_left_and_right() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_left_and_right_column.rs b/tests/generated/margin_auto_left_and_right_column.rs index 79150e3ab..a88dacdfc 100644 --- a/tests/generated/margin_auto_left_and_right_column.rs +++ b/tests/generated/margin_auto_left_and_right_column.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_left_and_right_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ fn margin_auto_left_and_right_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Auto, - right: taffy::style::Dimension::Auto, - ..Default::default() + left: taffy::style::LengthPercentageAuto::Auto, + right: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -25,7 +27,7 @@ fn margin_auto_left_and_right_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -39,7 +41,7 @@ fn margin_auto_left_and_right_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -47,6 +49,9 @@ fn margin_auto_left_and_right_column() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_left_and_right_column_and_center.rs b/tests/generated/margin_auto_left_and_right_column_and_center.rs index bb896a689..3cfee4430 100644 --- a/tests/generated/margin_auto_left_and_right_column_and_center.rs +++ b/tests/generated/margin_auto_left_and_right_column_and_center.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_left_and_right_column_and_center() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ fn margin_auto_left_and_right_column_and_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Auto, - right: taffy::style::Dimension::Auto, - ..Default::default() + left: taffy::style::LengthPercentageAuto::Auto, + right: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -25,7 +27,7 @@ fn margin_auto_left_and_right_column_and_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -39,7 +41,7 @@ fn margin_auto_left_and_right_column_and_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -47,6 +49,9 @@ fn margin_auto_left_and_right_column_and_center() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_left_and_right_strech.rs b/tests/generated/margin_auto_left_and_right_strech.rs index 023d03c5f..97a29c553 100644 --- a/tests/generated/margin_auto_left_and_right_strech.rs +++ b/tests/generated/margin_auto_left_and_right_strech.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_left_and_right_strech() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ fn margin_auto_left_and_right_strech() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Auto, - right: taffy::style::Dimension::Auto, - ..Default::default() + left: taffy::style::LengthPercentageAuto::Auto, + right: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -25,7 +27,7 @@ fn margin_auto_left_and_right_strech() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -38,7 +40,7 @@ fn margin_auto_left_and_right_strech() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,6 +48,9 @@ fn margin_auto_left_and_right_strech() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_left_child_bigger_than_parent.rs b/tests/generated/margin_auto_left_child_bigger_than_parent.rs index 9294be1ee..50f40f3f5 100644 --- a/tests/generated/margin_auto_left_child_bigger_than_parent.rs +++ b/tests/generated/margin_auto_left_child_bigger_than_parent.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_left_child_bigger_than_parent() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,9 @@ fn margin_auto_left_child_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(72f32), height: taffy::style::Dimension::Points(72f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { left: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { left: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -22,7 +24,7 @@ fn margin_auto_left_child_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(52f32), height: taffy::style::Dimension::Points(52f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,6 +32,9 @@ fn margin_auto_left_child_bigger_than_parent() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 52f32); assert_eq!(taffy.layout(node).unwrap().size.height, 52f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_left_fix_right_child_bigger_than_parent.rs b/tests/generated/margin_auto_left_fix_right_child_bigger_than_parent.rs index e203c2cf8..071ae075c 100644 --- a/tests/generated/margin_auto_left_fix_right_child_bigger_than_parent.rs +++ b/tests/generated/margin_auto_left_fix_right_child_bigger_than_parent.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_left_fix_right_child_bigger_than_parent() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ fn margin_auto_left_fix_right_child_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(72f32), height: taffy::style::Dimension::Points(72f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Auto, - right: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Auto, + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -26,7 +28,7 @@ fn margin_auto_left_fix_right_child_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(52f32), height: taffy::style::Dimension::Points(52f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,6 +36,9 @@ fn margin_auto_left_fix_right_child_bigger_than_parent() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 52f32); assert_eq!(taffy.layout(node).unwrap().size.height, 52f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_left_right_child_bigger_than_parent.rs b/tests/generated/margin_auto_left_right_child_bigger_than_parent.rs index 50f11daf4..9e2ace60b 100644 --- a/tests/generated/margin_auto_left_right_child_bigger_than_parent.rs +++ b/tests/generated/margin_auto_left_right_child_bigger_than_parent.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_left_right_child_bigger_than_parent() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ fn margin_auto_left_right_child_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(72f32), height: taffy::style::Dimension::Points(72f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Auto, - right: taffy::style::Dimension::Auto, - ..Default::default() + left: taffy::style::LengthPercentageAuto::Auto, + right: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -26,7 +28,7 @@ fn margin_auto_left_right_child_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(52f32), height: taffy::style::Dimension::Points(52f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,6 +36,9 @@ fn margin_auto_left_right_child_bigger_than_parent() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 52f32); assert_eq!(taffy.layout(node).unwrap().size.height, 52f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_left_stretching_child.rs b/tests/generated/margin_auto_left_stretching_child.rs index f3afc7938..5abd123ab 100644 --- a/tests/generated/margin_auto_left_stretching_child.rs +++ b/tests/generated/margin_auto_left_stretching_child.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_left_stretching_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn margin_auto_left_stretching_child() { flex_grow: 1f32, flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), - margin: taffy::geometry::Rect { left: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { left: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -19,7 +21,7 @@ fn margin_auto_left_stretching_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn margin_auto_left_stretching_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -41,6 +43,9 @@ fn margin_auto_left_stretching_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_mutiple_children_column.rs b/tests/generated/margin_auto_mutiple_children_column.rs index b8223d756..1b307cad6 100644 --- a/tests/generated/margin_auto_mutiple_children_column.rs +++ b/tests/generated/margin_auto_mutiple_children_column.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_mutiple_children_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,9 @@ fn margin_auto_mutiple_children_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { top: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -21,9 +23,9 @@ fn margin_auto_mutiple_children_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { top: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ fn margin_auto_mutiple_children_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -50,7 +52,7 @@ fn margin_auto_mutiple_children_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,6 +60,9 @@ fn margin_auto_mutiple_children_column() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_mutiple_children_row.rs b/tests/generated/margin_auto_mutiple_children_row.rs index 642f51e27..9ba95d9a9 100644 --- a/tests/generated/margin_auto_mutiple_children_row.rs +++ b/tests/generated/margin_auto_mutiple_children_row.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_mutiple_children_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,9 @@ fn margin_auto_mutiple_children_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { right: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { right: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -21,9 +23,9 @@ fn margin_auto_mutiple_children_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { right: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { right: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -35,7 +37,7 @@ fn margin_auto_mutiple_children_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -49,7 +51,7 @@ fn margin_auto_mutiple_children_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -57,6 +59,9 @@ fn margin_auto_mutiple_children_row() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_right.rs b/tests/generated/margin_auto_right.rs index 6e4036632..18b9f6319 100644 --- a/tests/generated/margin_auto_right.rs +++ b/tests/generated/margin_auto_right.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_right() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,9 @@ fn margin_auto_right() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { right: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { right: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ fn margin_auto_right() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -35,7 +37,7 @@ fn margin_auto_right() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn margin_auto_right() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_top.rs b/tests/generated/margin_auto_top.rs index 193519e9e..df7ee5813 100644 --- a/tests/generated/margin_auto_top.rs +++ b/tests/generated/margin_auto_top.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_top() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,9 +9,9 @@ fn margin_auto_top() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { top: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -21,7 +23,7 @@ fn margin_auto_top() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -35,7 +37,7 @@ fn margin_auto_top() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +45,9 @@ fn margin_auto_top() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_top_and_bottom_strech.rs b/tests/generated/margin_auto_top_and_bottom_strech.rs index 9fbfc8750..d63120bad 100644 --- a/tests/generated/margin_auto_top_and_bottom_strech.rs +++ b/tests/generated/margin_auto_top_and_bottom_strech.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_top_and_bottom_strech() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ fn margin_auto_top_and_bottom_strech() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - top: taffy::style::Dimension::Auto, - bottom: taffy::style::Dimension::Auto, - ..Default::default() + top: taffy::style::LengthPercentageAuto::Auto, + bottom: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -25,7 +27,7 @@ fn margin_auto_top_and_bottom_strech() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -39,7 +41,7 @@ fn margin_auto_top_and_bottom_strech() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -47,6 +49,9 @@ fn margin_auto_top_and_bottom_strech() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_auto_top_stretching_child.rs b/tests/generated/margin_auto_top_stretching_child.rs index 7286517b3..8af38f8c4 100644 --- a/tests/generated/margin_auto_top_stretching_child.rs +++ b/tests/generated/margin_auto_top_stretching_child.rs @@ -1,5 +1,7 @@ #[test] fn margin_auto_top_stretching_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn margin_auto_top_stretching_child() { flex_grow: 1f32, flex_shrink: 1f32, flex_basis: taffy::style::Dimension::Percent(0f32), - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Auto, ..Default::default() }, + margin: taffy::geometry::Rect { top: taffy::style::LengthPercentageAuto::Auto, ..Rect::zero() }, ..Default::default() }, &[], @@ -19,7 +21,7 @@ fn margin_auto_top_stretching_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn margin_auto_top_stretching_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -41,6 +43,9 @@ fn margin_auto_top_stretching_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_bottom.rs b/tests/generated/margin_bottom.rs index b05894906..9caa80651 100644 --- a/tests/generated/margin_bottom.rs +++ b/tests/generated/margin_bottom.rs @@ -1,11 +1,16 @@ #[test] fn margin_bottom() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, - margin: taffy::geometry::Rect { bottom: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + margin: taffy::geometry::Rect { + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[], @@ -19,7 +24,7 @@ fn margin_bottom() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -27,6 +32,9 @@ fn margin_bottom() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_fix_left_auto_right_child_bigger_than_parent.rs b/tests/generated/margin_fix_left_auto_right_child_bigger_than_parent.rs index 649b6c151..d5d805da1 100644 --- a/tests/generated/margin_fix_left_auto_right_child_bigger_than_parent.rs +++ b/tests/generated/margin_fix_left_auto_right_child_bigger_than_parent.rs @@ -1,5 +1,7 @@ #[test] fn margin_fix_left_auto_right_child_bigger_than_parent() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ fn margin_fix_left_auto_right_child_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(72f32), height: taffy::style::Dimension::Points(72f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Auto, - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(10f32), + right: taffy::style::LengthPercentageAuto::Auto, + ..Rect::zero() }, ..Default::default() }, @@ -26,7 +28,7 @@ fn margin_fix_left_auto_right_child_bigger_than_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(52f32), height: taffy::style::Dimension::Points(52f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -34,6 +36,9 @@ fn margin_fix_left_auto_right_child_bigger_than_parent() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 52f32); assert_eq!(taffy.layout(node).unwrap().size.height, 52f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_left.rs b/tests/generated/margin_left.rs index 42c2d910f..9429aa2ac 100644 --- a/tests/generated/margin_left.rs +++ b/tests/generated/margin_left.rs @@ -1,11 +1,16 @@ #[test] fn margin_left() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, - margin: taffy::geometry::Rect { left: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + margin: taffy::geometry::Rect { + left: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[], @@ -17,7 +22,7 @@ fn margin_left() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -25,6 +30,9 @@ fn margin_left() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_right.rs b/tests/generated/margin_right.rs index f76329196..11463a1a5 100644 --- a/tests/generated/margin_right.rs +++ b/tests/generated/margin_right.rs @@ -1,11 +1,16 @@ #[test] fn margin_right() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, - margin: taffy::geometry::Rect { right: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + margin: taffy::geometry::Rect { + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[], @@ -18,7 +23,7 @@ fn margin_right() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -26,6 +31,9 @@ fn margin_right() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_should_not_be_part_of_max_height.rs b/tests/generated/margin_should_not_be_part_of_max_height.rs index 879c7747d..91f13dc15 100644 --- a/tests/generated/margin_should_not_be_part_of_max_height.rs +++ b/tests/generated/margin_should_not_be_part_of_max_height.rs @@ -1,5 +1,7 @@ #[test] fn margin_should_not_be_part_of_max_height() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,13 +9,13 @@ fn margin_should_not_be_part_of_max_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + margin: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(20f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Points(20f32), ..Default::default() }, ..Default::default() }, &[], @@ -25,7 +27,7 @@ fn margin_should_not_be_part_of_max_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(250f32), height: taffy::style::Dimension::Points(250f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,6 +35,9 @@ fn margin_should_not_be_part_of_max_height() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 250f32); assert_eq!(taffy.layout(node).unwrap().size.height, 250f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_should_not_be_part_of_max_width.rs b/tests/generated/margin_should_not_be_part_of_max_width.rs index 9771ad708..508536a66 100644 --- a/tests/generated/margin_should_not_be_part_of_max_width.rs +++ b/tests/generated/margin_should_not_be_part_of_max_width.rs @@ -1,5 +1,7 @@ #[test] fn margin_should_not_be_part_of_max_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,13 +9,13 @@ fn margin_should_not_be_part_of_max_width() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + margin: taffy::geometry::Rect { + left: taffy::style::LengthPercentageAuto::Points(20f32), + ..Rect::zero() }, - margin: taffy::geometry::Rect { left: taffy::style::Dimension::Points(20f32), ..Default::default() }, ..Default::default() }, &[], @@ -25,7 +27,7 @@ fn margin_should_not_be_part_of_max_width() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(250f32), height: taffy::style::Dimension::Points(250f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,6 +35,9 @@ fn margin_should_not_be_part_of_max_width() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 250f32); assert_eq!(taffy.layout(node).unwrap().size.height, 250f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_top.rs b/tests/generated/margin_top.rs index c80a14d09..b9d323dc1 100644 --- a/tests/generated/margin_top.rs +++ b/tests/generated/margin_top.rs @@ -1,11 +1,16 @@ #[test] fn margin_top() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + margin: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[], @@ -18,7 +23,7 @@ fn margin_top() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -26,6 +31,9 @@ fn margin_top() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_with_sibling_column.rs b/tests/generated/margin_with_sibling_column.rs index 3a5823f3b..5a012e569 100644 --- a/tests/generated/margin_with_sibling_column.rs +++ b/tests/generated/margin_with_sibling_column.rs @@ -1,11 +1,16 @@ #[test] fn margin_with_sibling_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - margin: taffy::geometry::Rect { bottom: taffy::style::Dimension::Points(10f32), ..Default::default() }, + margin: taffy::geometry::Rect { + bottom: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[], @@ -19,7 +24,7 @@ fn margin_with_sibling_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -27,6 +32,9 @@ fn margin_with_sibling_column() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/margin_with_sibling_row.rs b/tests/generated/margin_with_sibling_row.rs index d9e648dd7..3d9e15be2 100644 --- a/tests/generated/margin_with_sibling_row.rs +++ b/tests/generated/margin_with_sibling_row.rs @@ -1,11 +1,16 @@ #[test] fn margin_with_sibling_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - margin: taffy::geometry::Rect { right: taffy::style::Dimension::Points(10f32), ..Default::default() }, + margin: taffy::geometry::Rect { + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[], @@ -18,7 +23,7 @@ fn margin_with_sibling_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -26,6 +31,9 @@ fn margin_with_sibling_row() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/max_height.rs b/tests/generated/max_height.rs index e53570db0..2530719b9 100644 --- a/tests/generated/max_height.rs +++ b/tests/generated/max_height.rs @@ -1,14 +1,13 @@ #[test] fn max_height() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(50f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -20,7 +19,7 @@ fn max_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -28,6 +27,9 @@ fn max_height() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/max_height_overrides_height.rs b/tests/generated/max_height_overrides_height.rs index 304b9b6fe..8b7aceb5f 100644 --- a/tests/generated/max_height_overrides_height.rs +++ b/tests/generated/max_height_overrides_height.rs @@ -1,14 +1,13 @@ #[test] fn max_height_overrides_height() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(200f32), ..Default::default() }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(200f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,6 +15,9 @@ fn max_height_overrides_height() { .unwrap(); let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node0]).unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 0f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/max_height_overrides_height_on_root.rs b/tests/generated/max_height_overrides_height_on_root.rs index 6a93edc8a..f9056bf13 100644 --- a/tests/generated/max_height_overrides_height_on_root.rs +++ b/tests/generated/max_height_overrides_height_on_root.rs @@ -1,20 +1,22 @@ #[test] fn max_height_overrides_height_on_root() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(200f32), ..Default::default() }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(200f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 0f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/max_width.rs b/tests/generated/max_width.rs index a5d567af2..030eafa8f 100644 --- a/tests/generated/max_width.rs +++ b/tests/generated/max_width.rs @@ -1,11 +1,13 @@ #[test] fn max_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, - max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -18,7 +20,7 @@ fn max_width() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -26,6 +28,9 @@ fn max_width() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/max_width_overrides_width.rs b/tests/generated/max_width_overrides_width.rs index 41c185c6c..0582128ae 100644 --- a/tests/generated/max_width_overrides_width.rs +++ b/tests/generated/max_width_overrides_width.rs @@ -1,14 +1,13 @@ #[test] fn max_width_overrides_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Default::default() }, - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Size::auto() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,6 +15,9 @@ fn max_width_overrides_width() { .unwrap(); let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node0]).unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 0f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/max_width_overrides_width_on_root.rs b/tests/generated/max_width_overrides_width_on_root.rs index 6bbc42556..f6428d362 100644 --- a/tests/generated/max_width_overrides_width_on_root.rs +++ b/tests/generated/max_width_overrides_width_on_root.rs @@ -1,20 +1,22 @@ #[test] fn max_width_overrides_width_on_root() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Default::default() }, - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Size::auto() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 0f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/min_height.rs b/tests/generated/min_height.rs index 0aaa9b9bf..9409e3bf2 100644 --- a/tests/generated/min_height.rs +++ b/tests/generated/min_height.rs @@ -1,14 +1,13 @@ #[test] fn min_height() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(60f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -22,7 +21,7 @@ fn min_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -30,6 +29,9 @@ fn min_height() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/min_height_overrides_height.rs b/tests/generated/min_height_overrides_height.rs index 4cdd882b2..af1da80fa 100644 --- a/tests/generated/min_height_overrides_height.rs +++ b/tests/generated/min_height_overrides_height.rs @@ -1,14 +1,13 @@ #[test] fn min_height_overrides_height() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,6 +15,9 @@ fn min_height_overrides_height() { .unwrap(); let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node0]).unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 0f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/min_height_overrides_height_on_root.rs b/tests/generated/min_height_overrides_height_on_root.rs index 145b53b84..fe01b8e52 100644 --- a/tests/generated/min_height_overrides_height_on_root.rs +++ b/tests/generated/min_height_overrides_height_on_root.rs @@ -1,20 +1,22 @@ #[test] fn min_height_overrides_height_on_root() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() }, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 0f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/min_height_overrides_max_height.rs b/tests/generated/min_height_overrides_max_height.rs index 8d72d8d16..e660b4c0a 100644 --- a/tests/generated/min_height_overrides_max_height.rs +++ b/tests/generated/min_height_overrides_max_height.rs @@ -1,17 +1,13 @@ #[test] fn min_height_overrides_max_height() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(50f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -19,6 +15,9 @@ fn min_height_overrides_max_height() { .unwrap(); let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node0]).unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 0f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/min_max_percent_no_width_height.rs b/tests/generated/min_max_percent_no_width_height.rs index ea81b430d..e9aaee2d3 100644 --- a/tests/generated/min_max_percent_no_width_height.rs +++ b/tests/generated/min_max_percent_no_width_height.rs @@ -1,5 +1,7 @@ #[test] fn min_max_percent_no_width_height() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ fn min_max_percent_no_width_height() { min_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.1f32), height: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + ..Size::auto() }, max_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.1f32), height: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -27,7 +29,7 @@ fn min_max_percent_no_width_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -35,6 +37,9 @@ fn min_max_percent_no_width_height() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/min_width.rs b/tests/generated/min_width.rs index b0f6b8759..34ac93bd7 100644 --- a/tests/generated/min_width.rs +++ b/tests/generated/min_width.rs @@ -1,11 +1,13 @@ #[test] fn min_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() }, ..Default::default() }, &[], @@ -18,7 +20,7 @@ fn min_width() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -26,6 +28,9 @@ fn min_width() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/min_width_overrides_max_width.rs b/tests/generated/min_width_overrides_max_width.rs index ae8d7dea5..e06216523 100644 --- a/tests/generated/min_width_overrides_max_width.rs +++ b/tests/generated/min_width_overrides_max_width.rs @@ -1,14 +1,13 @@ #[test] fn min_width_overrides_max_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,6 +15,9 @@ fn min_width_overrides_max_width() { .unwrap(); let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node0]).unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 0f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/min_width_overrides_width.rs b/tests/generated/min_width_overrides_width.rs index 934e8ba12..3a04fa161 100644 --- a/tests/generated/min_width_overrides_width.rs +++ b/tests/generated/min_width_overrides_width.rs @@ -1,14 +1,13 @@ #[test] fn min_width_overrides_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,6 +15,9 @@ fn min_width_overrides_width() { .unwrap(); let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node0]).unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 0f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/min_width_overrides_width_on_root.rs b/tests/generated/min_width_overrides_width_on_root.rs index aa295a67c..9d27f8f5f 100644 --- a/tests/generated/min_width_overrides_width_on_root.rs +++ b/tests/generated/min_width_overrides_width_on_root.rs @@ -1,20 +1,22 @@ #[test] fn min_width_overrides_width_on_root() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() }, - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100f32), - ..Default::default() - }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 0f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/nested_overflowing_child.rs b/tests/generated/nested_overflowing_child.rs index 25cd10e12..8fd8080a1 100644 --- a/tests/generated/nested_overflowing_child.rs +++ b/tests/generated/nested_overflowing_child.rs @@ -1,5 +1,7 @@ #[test] fn nested_overflowing_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn nested_overflowing_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,7 +23,7 @@ fn nested_overflowing_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -29,6 +31,9 @@ fn nested_overflowing_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/nested_overflowing_child_in_constraint_parent.rs b/tests/generated/nested_overflowing_child_in_constraint_parent.rs index cd9236278..55d1a8f0d 100644 --- a/tests/generated/nested_overflowing_child_in_constraint_parent.rs +++ b/tests/generated/nested_overflowing_child_in_constraint_parent.rs @@ -1,5 +1,7 @@ #[test] fn nested_overflowing_child_in_constraint_parent() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn nested_overflowing_child_in_constraint_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn nested_overflowing_child_in_constraint_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn nested_overflowing_child_in_constraint_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -41,6 +43,9 @@ fn nested_overflowing_child_in_constraint_parent() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/overflow_cross_axis.rs b/tests/generated/overflow_cross_axis.rs index 0c23af9de..60b2a763d 100644 --- a/tests/generated/overflow_cross_axis.rs +++ b/tests/generated/overflow_cross_axis.rs @@ -1,5 +1,7 @@ #[test] fn overflow_cross_axis() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn overflow_cross_axis() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn overflow_cross_axis() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -28,6 +30,9 @@ fn overflow_cross_axis() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/overflow_main_axis.rs b/tests/generated/overflow_main_axis.rs index 2f2332d64..f8c47a687 100644 --- a/tests/generated/overflow_main_axis.rs +++ b/tests/generated/overflow_main_axis.rs @@ -1,11 +1,13 @@ #[test] fn overflow_main_axis() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_shrink: 0f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[], @@ -17,7 +19,7 @@ fn overflow_main_axis() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -25,6 +27,9 @@ fn overflow_main_axis() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/padding_align_end_child.rs b/tests/generated/padding_align_end_child.rs index 7c55fa105..d0f929e16 100644 --- a/tests/generated/padding_align_end_child.rs +++ b/tests/generated/padding_align_end_child.rs @@ -1,5 +1,7 @@ #[test] fn padding_align_end_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,14 +9,14 @@ fn padding_align_end_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(20f32), - right: taffy::style::Dimension::Points(20f32), - top: taffy::style::Dimension::Points(20f32), - bottom: taffy::style::Dimension::Points(20f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(20f32), + right: taffy::style::LengthPercentage::Points(20f32), + top: taffy::style::LengthPercentage::Points(20f32), + bottom: taffy::style::LengthPercentage::Points(20f32), + ..Rect::zero() }, ..Default::default() }, @@ -29,7 +31,7 @@ fn padding_align_end_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -37,6 +39,9 @@ fn padding_align_end_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/padding_center_child.rs b/tests/generated/padding_center_child.rs index eeddd1405..10cdab879 100644 --- a/tests/generated/padding_center_child.rs +++ b/tests/generated/padding_center_child.rs @@ -1,5 +1,7 @@ #[test] fn padding_center_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn padding_center_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -22,14 +24,14 @@ fn padding_center_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(20f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(20f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(20f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(20f32), + ..Rect::zero() }, ..Default::default() }, @@ -37,6 +39,9 @@ fn padding_center_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/padding_flex_child.rs b/tests/generated/padding_flex_child.rs index c7236262b..e7f49d3cc 100644 --- a/tests/generated/padding_flex_child.rs +++ b/tests/generated/padding_flex_child.rs @@ -1,11 +1,13 @@ #[test] fn padding_flex_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -17,14 +19,14 @@ fn padding_flex_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -32,6 +34,9 @@ fn padding_flex_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/padding_no_child.rs b/tests/generated/padding_no_child.rs index c3e732b23..29a49851e 100644 --- a/tests/generated/padding_no_child.rs +++ b/tests/generated/padding_no_child.rs @@ -1,15 +1,17 @@ #[test] fn padding_no_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node = taffy .new_with_children( taffy::style::Style { padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -17,6 +19,9 @@ fn padding_no_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 20f32); assert_eq!(taffy.layout(node).unwrap().size.height, 20f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/padding_stretch_child.rs b/tests/generated/padding_stretch_child.rs index b612b5f36..7320c7631 100644 --- a/tests/generated/padding_stretch_child.rs +++ b/tests/generated/padding_stretch_child.rs @@ -1,10 +1,12 @@ #[test] fn padding_stretch_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,14 +18,14 @@ fn padding_stretch_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -31,6 +33,9 @@ fn padding_stretch_child() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/parent_wrap_child_size_overflowing_parent.rs b/tests/generated/parent_wrap_child_size_overflowing_parent.rs index 98ca5ee3c..bdd87ccda 100644 --- a/tests/generated/parent_wrap_child_size_overflowing_parent.rs +++ b/tests/generated/parent_wrap_child_size_overflowing_parent.rs @@ -1,5 +1,7 @@ #[test] fn parent_wrap_child_size_overflowing_parent() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn parent_wrap_child_size_overflowing_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -17,7 +19,7 @@ fn parent_wrap_child_size_overflowing_parent() { let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node00], @@ -29,7 +31,7 @@ fn parent_wrap_child_size_overflowing_parent() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -37,6 +39,9 @@ fn parent_wrap_child_size_overflowing_parent() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percent_absolute_position.rs b/tests/generated/percent_absolute_position.rs index ddd5b0964..0c55ad91b 100644 --- a/tests/generated/percent_absolute_position.rs +++ b/tests/generated/percent_absolute_position.rs @@ -1,10 +1,12 @@ #[test] fn percent_absolute_position() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn percent_absolute_position() { let node01 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Size::auto() }, ..Default::default() }, &[], @@ -26,11 +28,11 @@ fn percent_absolute_position() { size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Percent(0.5f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Percent(0.5f32), + ..Rect::auto() }, ..Default::default() }, @@ -44,7 +46,7 @@ fn percent_absolute_position() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -52,6 +54,9 @@ fn percent_absolute_position() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 60f32); assert_eq!(taffy.layout(node).unwrap().size.height, 50f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percent_within_flex_grow.rs b/tests/generated/percent_within_flex_grow.rs index 82e02748c..ce6c240f9 100644 --- a/tests/generated/percent_within_flex_grow.rs +++ b/tests/generated/percent_within_flex_grow.rs @@ -1,10 +1,12 @@ #[test] fn percent_within_flex_grow() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -13,7 +15,7 @@ fn percent_within_flex_grow() { let node10 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Size::auto() }, ..Default::default() }, &[], @@ -32,7 +34,7 @@ fn percent_within_flex_grow() { let node2 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[], @@ -44,7 +46,7 @@ fn percent_within_flex_grow() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(350f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -52,6 +54,9 @@ fn percent_within_flex_grow() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 350f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_absolute_position.rs b/tests/generated/percentage_absolute_position.rs index b56eaa296..549fd8e2c 100644 --- a/tests/generated/percentage_absolute_position.rs +++ b/tests/generated/percentage_absolute_position.rs @@ -1,5 +1,7 @@ #[test] fn percentage_absolute_position() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -8,12 +10,12 @@ fn percentage_absolute_position() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Percent(0.3f32), - top: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Percent(0.3f32), + top: taffy::style::LengthPercentageAuto::Percent(0.1f32), + ..Rect::auto() }, ..Default::default() }, @@ -27,7 +29,7 @@ fn percentage_absolute_position() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -35,6 +37,9 @@ fn percentage_absolute_position() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_container_in_wrapping_container.rs b/tests/generated/percentage_container_in_wrapping_container.rs index 2fba90057..8477bb6d8 100644 --- a/tests/generated/percentage_container_in_wrapping_container.rs +++ b/tests/generated/percentage_container_in_wrapping_container.rs @@ -1,5 +1,7 @@ #[test] fn percentage_container_in_wrapping_container() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn percentage_container_in_wrapping_container() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn percentage_container_in_wrapping_container() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -31,7 +33,7 @@ fn percentage_container_in_wrapping_container() { .new_with_children( taffy::style::Style { justify_content: taffy::style::JustifyContent::Center, - size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), ..Size::auto() }, ..Default::default() }, &[node000, node001], @@ -52,7 +54,7 @@ fn percentage_container_in_wrapping_container() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -60,6 +62,9 @@ fn percentage_container_in_wrapping_container() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_flex_basis.rs b/tests/generated/percentage_flex_basis.rs index da6c9e427..92f445004 100644 --- a/tests/generated/percentage_flex_basis.rs +++ b/tests/generated/percentage_flex_basis.rs @@ -1,5 +1,7 @@ #[test] fn percentage_flex_basis() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -27,7 +29,7 @@ fn percentage_flex_basis() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -35,6 +37,9 @@ fn percentage_flex_basis() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_flex_basis_cross.rs b/tests/generated/percentage_flex_basis_cross.rs index d8e61a515..e9dfb35c8 100644 --- a/tests/generated/percentage_flex_basis_cross.rs +++ b/tests/generated/percentage_flex_basis_cross.rs @@ -1,5 +1,7 @@ #[test] fn percentage_flex_basis_cross() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -28,7 +30,7 @@ fn percentage_flex_basis_cross() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -36,6 +38,9 @@ fn percentage_flex_basis_cross() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 400f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_flex_basis_cross_max_height.rs b/tests/generated/percentage_flex_basis_cross_max_height.rs index ee6255625..3f02bf289 100644 --- a/tests/generated/percentage_flex_basis_cross_max_height.rs +++ b/tests/generated/percentage_flex_basis_cross_max_height.rs @@ -1,15 +1,14 @@ #[test] fn percentage_flex_basis_cross_max_height() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, ..Default::default() }, &[], @@ -20,10 +19,7 @@ fn percentage_flex_basis_cross_max_height() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Percent(0.2f32), ..Size::auto() }, ..Default::default() }, &[], @@ -36,7 +32,7 @@ fn percentage_flex_basis_cross_max_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -44,6 +40,9 @@ fn percentage_flex_basis_cross_max_height() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 400f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_flex_basis_cross_max_width.rs b/tests/generated/percentage_flex_basis_cross_max_width.rs index 6c6e517c9..20e0d8d0a 100644 --- a/tests/generated/percentage_flex_basis_cross_max_width.rs +++ b/tests/generated/percentage_flex_basis_cross_max_width.rs @@ -1,15 +1,14 @@ #[test] fn percentage_flex_basis_cross_max_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, ..Default::default() }, &[], @@ -20,10 +19,7 @@ fn percentage_flex_basis_cross_max_width() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Percent(0.15f32), - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Size::auto() }, ..Default::default() }, &[], @@ -36,7 +32,7 @@ fn percentage_flex_basis_cross_max_width() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -44,6 +40,9 @@ fn percentage_flex_basis_cross_max_width() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 400f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_flex_basis_cross_min_height.rs b/tests/generated/percentage_flex_basis_cross_min_height.rs index 56b007929..a17261924 100644 --- a/tests/generated/percentage_flex_basis_cross_min_height.rs +++ b/tests/generated/percentage_flex_basis_cross_min_height.rs @@ -1,14 +1,13 @@ #[test] fn percentage_flex_basis_cross_min_height() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, ..Default::default() }, &[], @@ -18,10 +17,7 @@ fn percentage_flex_basis_cross_min_height() { .new_with_children( taffy::style::Style { flex_grow: 2f32, - min_size: taffy::geometry::Size { - height: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { height: taffy::style::Dimension::Percent(0.1f32), ..Size::auto() }, ..Default::default() }, &[], @@ -34,7 +30,7 @@ fn percentage_flex_basis_cross_min_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -42,6 +38,9 @@ fn percentage_flex_basis_cross_min_height() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 400f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_flex_basis_cross_min_width.rs b/tests/generated/percentage_flex_basis_cross_min_width.rs index fdda48056..e46102b0c 100644 --- a/tests/generated/percentage_flex_basis_cross_min_width.rs +++ b/tests/generated/percentage_flex_basis_cross_min_width.rs @@ -1,15 +1,14 @@ #[test] fn percentage_flex_basis_cross_min_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, ..Default::default() }, &[], @@ -20,10 +19,7 @@ fn percentage_flex_basis_cross_min_width() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Percent(0.15f32), - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Size::auto() }, ..Default::default() }, &[], @@ -36,7 +32,7 @@ fn percentage_flex_basis_cross_min_width() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -44,6 +40,9 @@ fn percentage_flex_basis_cross_min_width() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 400f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_flex_basis_main_max_height.rs b/tests/generated/percentage_flex_basis_main_max_height.rs index 255932dee..49562df76 100644 --- a/tests/generated/percentage_flex_basis_main_max_height.rs +++ b/tests/generated/percentage_flex_basis_main_max_height.rs @@ -1,15 +1,14 @@ #[test] fn percentage_flex_basis_main_max_height() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, ..Default::default() }, &[], @@ -20,10 +19,7 @@ fn percentage_flex_basis_main_max_height() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Percent(0.2f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +31,7 @@ fn percentage_flex_basis_main_max_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +39,9 @@ fn percentage_flex_basis_main_max_height() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 400f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_flex_basis_main_max_width.rs b/tests/generated/percentage_flex_basis_main_max_width.rs index 3d2860eed..d4fca7bc3 100644 --- a/tests/generated/percentage_flex_basis_main_max_width.rs +++ b/tests/generated/percentage_flex_basis_main_max_width.rs @@ -1,15 +1,14 @@ #[test] fn percentage_flex_basis_main_max_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Percent(0.15f32), - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, ..Default::default() }, &[], @@ -20,10 +19,7 @@ fn percentage_flex_basis_main_max_width() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - max_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() - }, + max_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +31,7 @@ fn percentage_flex_basis_main_max_width() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +39,9 @@ fn percentage_flex_basis_main_max_width() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 400f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_flex_basis_main_min_width.rs b/tests/generated/percentage_flex_basis_main_min_width.rs index 3aee3efd0..04da65f83 100644 --- a/tests/generated/percentage_flex_basis_main_min_width.rs +++ b/tests/generated/percentage_flex_basis_main_min_width.rs @@ -1,15 +1,14 @@ #[test] fn percentage_flex_basis_main_min_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Percent(0.15f32), - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, ..Default::default() }, &[], @@ -20,10 +19,7 @@ fn percentage_flex_basis_main_min_width() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Size::auto() }, ..Default::default() }, &[], @@ -35,7 +31,7 @@ fn percentage_flex_basis_main_min_width() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,6 +39,9 @@ fn percentage_flex_basis_main_min_width() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 400f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_margin_should_calculate_based_only_on_width.rs b/tests/generated/percentage_margin_should_calculate_based_only_on_width.rs index b6fc65ff0..88ca693cb 100644 --- a/tests/generated/percentage_margin_should_calculate_based_only_on_width.rs +++ b/tests/generated/percentage_margin_should_calculate_based_only_on_width.rs @@ -1,5 +1,7 @@ #[test] fn percentage_margin_should_calculate_based_only_on_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn percentage_margin_should_calculate_based_only_on_width() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,11 +22,11 @@ fn percentage_margin_should_calculate_based_only_on_width() { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Percent(0.1f32), - right: taffy::style::Dimension::Percent(0.1f32), - top: taffy::style::Dimension::Percent(0.1f32), - bottom: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Percent(0.1f32), + right: taffy::style::LengthPercentageAuto::Percent(0.1f32), + top: taffy::style::LengthPercentageAuto::Percent(0.1f32), + bottom: taffy::style::LengthPercentageAuto::Percent(0.1f32), + ..Rect::zero() }, ..Default::default() }, @@ -38,7 +40,7 @@ fn percentage_margin_should_calculate_based_only_on_width() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,6 +48,9 @@ fn percentage_margin_should_calculate_based_only_on_width() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_multiple_nested_with_padding_margin_and_percentage_values.rs b/tests/generated/percentage_multiple_nested_with_padding_margin_and_percentage_values.rs index 2cd489621..3a1edfc14 100644 --- a/tests/generated/percentage_multiple_nested_with_padding_margin_and_percentage_values.rs +++ b/tests/generated/percentage_multiple_nested_with_padding_margin_and_percentage_values.rs @@ -1,23 +1,25 @@ #[test] fn percentage_multiple_nested_with_padding_margin_and_percentage_values() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.45f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.45f32), ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Percent(0.05f32), - right: taffy::style::Dimension::Percent(0.05f32), - top: taffy::style::Dimension::Percent(0.05f32), - bottom: taffy::style::Dimension::Percent(0.05f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Percent(0.05f32), + right: taffy::style::LengthPercentageAuto::Percent(0.05f32), + top: taffy::style::LengthPercentageAuto::Percent(0.05f32), + bottom: taffy::style::LengthPercentageAuto::Percent(0.05f32), + ..Rect::zero() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(3f32), - right: taffy::style::Dimension::Points(3f32), - top: taffy::style::Dimension::Points(3f32), - bottom: taffy::style::Dimension::Points(3f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(3f32), + right: taffy::style::LengthPercentage::Points(3f32), + top: taffy::style::LengthPercentage::Points(3f32), + bottom: taffy::style::LengthPercentage::Points(3f32), + ..Rect::zero() }, ..Default::default() }, @@ -28,20 +30,20 @@ fn percentage_multiple_nested_with_padding_margin_and_percentage_values() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.5f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.5f32), ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(5f32), - right: taffy::style::Dimension::Points(5f32), - top: taffy::style::Dimension::Points(5f32), - bottom: taffy::style::Dimension::Points(5f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(5f32), + right: taffy::style::LengthPercentageAuto::Points(5f32), + top: taffy::style::LengthPercentageAuto::Points(5f32), + bottom: taffy::style::LengthPercentageAuto::Points(5f32), + ..Rect::zero() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Percent(0.03f32), - right: taffy::style::Dimension::Percent(0.03f32), - top: taffy::style::Dimension::Percent(0.03f32), - bottom: taffy::style::Dimension::Percent(0.03f32), - ..Default::default() + left: taffy::style::LengthPercentage::Percent(0.03f32), + right: taffy::style::LengthPercentage::Percent(0.03f32), + top: taffy::style::LengthPercentage::Percent(0.03f32), + bottom: taffy::style::LengthPercentage::Percent(0.03f32), + ..Rect::zero() }, ..Default::default() }, @@ -54,23 +56,20 @@ fn percentage_multiple_nested_with_padding_margin_and_percentage_values() { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, flex_basis: taffy::style::Dimension::Percent(0.1f32), - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.6f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.6f32), ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(5f32), - right: taffy::style::Dimension::Points(5f32), - top: taffy::style::Dimension::Points(5f32), - bottom: taffy::style::Dimension::Points(5f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(5f32), + right: taffy::style::LengthPercentageAuto::Points(5f32), + top: taffy::style::LengthPercentageAuto::Points(5f32), + bottom: taffy::style::LengthPercentageAuto::Points(5f32), + ..Rect::zero() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(3f32), - right: taffy::style::Dimension::Points(3f32), - top: taffy::style::Dimension::Points(3f32), - bottom: taffy::style::Dimension::Points(3f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(3f32), + right: taffy::style::LengthPercentage::Points(3f32), + top: taffy::style::LengthPercentage::Points(3f32), + bottom: taffy::style::LengthPercentage::Points(3f32), + ..Rect::zero() }, ..Default::default() }, @@ -82,10 +81,7 @@ fn percentage_multiple_nested_with_padding_margin_and_percentage_values() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Percent(0.15f32), - min_size: taffy::geometry::Size { - width: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() - }, + min_size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.2f32), ..Size::auto() }, ..Default::default() }, &[], @@ -98,7 +94,7 @@ fn percentage_multiple_nested_with_padding_margin_and_percentage_values() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -106,6 +102,9 @@ fn percentage_multiple_nested_with_padding_margin_and_percentage_values() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_padding_should_calculate_based_only_on_width.rs b/tests/generated/percentage_padding_should_calculate_based_only_on_width.rs index adcae0c1e..27a06c035 100644 --- a/tests/generated/percentage_padding_should_calculate_based_only_on_width.rs +++ b/tests/generated/percentage_padding_should_calculate_based_only_on_width.rs @@ -1,5 +1,7 @@ #[test] fn percentage_padding_should_calculate_based_only_on_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn percentage_padding_should_calculate_based_only_on_width() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,11 +22,11 @@ fn percentage_padding_should_calculate_based_only_on_width() { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Percent(0.1f32), - right: taffy::style::Dimension::Percent(0.1f32), - top: taffy::style::Dimension::Percent(0.1f32), - bottom: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + left: taffy::style::LengthPercentage::Percent(0.1f32), + right: taffy::style::LengthPercentage::Percent(0.1f32), + top: taffy::style::LengthPercentage::Percent(0.1f32), + bottom: taffy::style::LengthPercentage::Percent(0.1f32), + ..Rect::zero() }, ..Default::default() }, @@ -38,7 +40,7 @@ fn percentage_padding_should_calculate_based_only_on_width() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,6 +48,9 @@ fn percentage_padding_should_calculate_based_only_on_width() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_position_bottom_right.rs b/tests/generated/percentage_position_bottom_right.rs index cb7b93133..43d687011 100644 --- a/tests/generated/percentage_position_bottom_right.rs +++ b/tests/generated/percentage_position_bottom_right.rs @@ -1,5 +1,7 @@ #[test] fn percentage_position_bottom_right() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ fn percentage_position_bottom_right() { size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.55f32), height: taffy::style::Dimension::Percent(0.15f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - right: taffy::style::Dimension::Percent(0.2f32), - bottom: taffy::style::Dimension::Percent(0.1f32), - ..Default::default() + right: taffy::style::LengthPercentageAuto::Percent(0.2f32), + bottom: taffy::style::LengthPercentageAuto::Percent(0.1f32), + ..Rect::auto() }, ..Default::default() }, @@ -25,7 +27,7 @@ fn percentage_position_bottom_right() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,6 +35,9 @@ fn percentage_position_bottom_right() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 500f32); assert_eq!(taffy.layout(node).unwrap().size.height, 500f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_position_left_top.rs b/tests/generated/percentage_position_left_top.rs index 0bb381af0..58d0ae022 100644 --- a/tests/generated/percentage_position_left_top.rs +++ b/tests/generated/percentage_position_left_top.rs @@ -1,5 +1,7 @@ #[test] fn percentage_position_left_top() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,12 @@ fn percentage_position_left_top() { size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.45f32), height: taffy::style::Dimension::Percent(0.55f32), - ..Default::default() + ..Size::auto() }, position: taffy::geometry::Rect { - left: taffy::style::Dimension::Percent(0.1f32), - top: taffy::style::Dimension::Percent(0.2f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Percent(0.1f32), + top: taffy::style::LengthPercentageAuto::Percent(0.2f32), + ..Rect::auto() }, ..Default::default() }, @@ -25,7 +27,7 @@ fn percentage_position_left_top() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(400f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,6 +35,9 @@ fn percentage_position_left_top() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 400f32); assert_eq!(taffy.layout(node).unwrap().size.height, 400f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_size_based_on_parent_inner_size.rs b/tests/generated/percentage_size_based_on_parent_inner_size.rs index 064236546..2820097d8 100644 --- a/tests/generated/percentage_size_based_on_parent_inner_size.rs +++ b/tests/generated/percentage_size_based_on_parent_inner_size.rs @@ -1,5 +1,7 @@ #[test] fn percentage_size_based_on_parent_inner_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn percentage_size_based_on_parent_inner_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.5f32), height: taffy::style::Dimension::Percent(0.5f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,14 +23,14 @@ fn percentage_size_based_on_parent_inner_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(20f32), - right: taffy::style::Dimension::Points(20f32), - top: taffy::style::Dimension::Points(20f32), - bottom: taffy::style::Dimension::Points(20f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(20f32), + right: taffy::style::LengthPercentage::Points(20f32), + top: taffy::style::LengthPercentage::Points(20f32), + bottom: taffy::style::LengthPercentage::Points(20f32), + ..Rect::zero() }, ..Default::default() }, @@ -36,6 +38,9 @@ fn percentage_size_based_on_parent_inner_size() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 400f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_size_of_flex_basis.rs b/tests/generated/percentage_size_of_flex_basis.rs index cbbc85880..d8414628f 100644 --- a/tests/generated/percentage_size_of_flex_basis.rs +++ b/tests/generated/percentage_size_of_flex_basis.rs @@ -1,5 +1,7 @@ #[test] fn percentage_size_of_flex_basis() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn percentage_size_of_flex_basis() { size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(1f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -23,13 +25,16 @@ fn percentage_size_of_flex_basis() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_width_height.rs b/tests/generated/percentage_width_height.rs index 32fba1c47..49616baab 100644 --- a/tests/generated/percentage_width_height.rs +++ b/tests/generated/percentage_width_height.rs @@ -1,5 +1,7 @@ #[test] fn percentage_width_height() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn percentage_width_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.3f32), height: taffy::style::Dimension::Percent(0.3f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn percentage_width_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(400f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -28,6 +30,9 @@ fn percentage_width_height() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 400f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/percentage_width_height_undefined_parent_size.rs b/tests/generated/percentage_width_height_undefined_parent_size.rs index fe205d0ec..f56f23642 100644 --- a/tests/generated/percentage_width_height_undefined_parent_size.rs +++ b/tests/generated/percentage_width_height_undefined_parent_size.rs @@ -1,5 +1,7 @@ #[test] fn percentage_width_height_undefined_parent_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn percentage_width_height_undefined_parent_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Percent(0.5f32), height: taffy::style::Dimension::Percent(0.5f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -21,6 +23,9 @@ fn percentage_width_height_undefined_parent_size() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 0f32); assert_eq!(taffy.layout(node).unwrap().size.height, 0f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/relative_position_should_not_nudge_siblings.rs b/tests/generated/relative_position_should_not_nudge_siblings.rs index d0939e37d..aa83d7cd3 100644 --- a/tests/generated/relative_position_should_not_nudge_siblings.rs +++ b/tests/generated/relative_position_should_not_nudge_siblings.rs @@ -1,11 +1,16 @@ #[test] fn relative_position_should_not_nudge_siblings() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, - position: taffy::geometry::Rect { top: taffy::style::Dimension::Points(15f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + position: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(15f32), + ..Rect::auto() + }, ..Default::default() }, &[], @@ -14,8 +19,11 @@ fn relative_position_should_not_nudge_siblings() { let node1 = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, - position: taffy::geometry::Rect { top: taffy::style::Dimension::Points(15f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, + position: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(15f32), + ..Rect::auto() + }, ..Default::default() }, &[], @@ -28,7 +36,7 @@ fn relative_position_should_not_nudge_siblings() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -36,6 +44,9 @@ fn relative_position_should_not_nudge_siblings() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/rounding_flex_basis_flex_grow_row_prime_number_width.rs b/tests/generated/rounding_flex_basis_flex_grow_row_prime_number_width.rs index 84ed60631..b1909a9ee 100644 --- a/tests/generated/rounding_flex_basis_flex_grow_row_prime_number_width.rs +++ b/tests/generated/rounding_flex_basis_flex_grow_row_prime_number_width.rs @@ -1,5 +1,7 @@ #[test] fn rounding_flex_basis_flex_grow_row_prime_number_width() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); @@ -12,7 +14,7 @@ fn rounding_flex_basis_flex_grow_row_prime_number_width() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(113f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,6 +22,9 @@ fn rounding_flex_basis_flex_grow_row_prime_number_width() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 113f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/rounding_flex_basis_flex_grow_row_width_of_100.rs b/tests/generated/rounding_flex_basis_flex_grow_row_width_of_100.rs index 1a0504dd8..80cce3f03 100644 --- a/tests/generated/rounding_flex_basis_flex_grow_row_width_of_100.rs +++ b/tests/generated/rounding_flex_basis_flex_grow_row_width_of_100.rs @@ -1,5 +1,7 @@ #[test] fn rounding_flex_basis_flex_grow_row_width_of_100() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); let node1 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap(); @@ -10,7 +12,7 @@ fn rounding_flex_basis_flex_grow_row_width_of_100() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -18,6 +20,9 @@ fn rounding_flex_basis_flex_grow_row_width_of_100() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/rounding_flex_basis_flex_shrink_row.rs b/tests/generated/rounding_flex_basis_flex_shrink_row.rs index db1737b3e..dc67db524 100644 --- a/tests/generated/rounding_flex_basis_flex_shrink_row.rs +++ b/tests/generated/rounding_flex_basis_flex_shrink_row.rs @@ -1,5 +1,7 @@ #[test] fn rounding_flex_basis_flex_shrink_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -29,7 +31,7 @@ fn rounding_flex_basis_flex_shrink_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(101f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -37,6 +39,9 @@ fn rounding_flex_basis_flex_shrink_row() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 101f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/rounding_flex_basis_overrides_main_size.rs b/tests/generated/rounding_flex_basis_overrides_main_size.rs index 1041241f8..6a334218a 100644 --- a/tests/generated/rounding_flex_basis_overrides_main_size.rs +++ b/tests/generated/rounding_flex_basis_overrides_main_size.rs @@ -1,12 +1,14 @@ #[test] fn rounding_flex_basis_overrides_main_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,7 +18,7 @@ fn rounding_flex_basis_overrides_main_size() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -26,7 +28,7 @@ fn rounding_flex_basis_overrides_main_size() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -39,7 +41,7 @@ fn rounding_flex_basis_overrides_main_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(113f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -47,6 +49,9 @@ fn rounding_flex_basis_overrides_main_size() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 113f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/rounding_fractial_input_1.rs b/tests/generated/rounding_fractial_input_1.rs index 1e81b8cfe..6d7db5a1a 100644 --- a/tests/generated/rounding_fractial_input_1.rs +++ b/tests/generated/rounding_fractial_input_1.rs @@ -1,12 +1,14 @@ #[test] fn rounding_fractial_input_1() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,7 +18,7 @@ fn rounding_fractial_input_1() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -26,7 +28,7 @@ fn rounding_fractial_input_1() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -39,7 +41,7 @@ fn rounding_fractial_input_1() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(113.4f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -47,6 +49,9 @@ fn rounding_fractial_input_1() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 113f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/rounding_fractial_input_2.rs b/tests/generated/rounding_fractial_input_2.rs index 8ea29d4f2..14240650b 100644 --- a/tests/generated/rounding_fractial_input_2.rs +++ b/tests/generated/rounding_fractial_input_2.rs @@ -1,12 +1,14 @@ #[test] fn rounding_fractial_input_2() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,7 +18,7 @@ fn rounding_fractial_input_2() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -26,7 +28,7 @@ fn rounding_fractial_input_2() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -39,7 +41,7 @@ fn rounding_fractial_input_2() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(113.6f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -47,6 +49,9 @@ fn rounding_fractial_input_2() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 114f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/rounding_fractial_input_3.rs b/tests/generated/rounding_fractial_input_3.rs index c6153a048..6738314d7 100644 --- a/tests/generated/rounding_fractial_input_3.rs +++ b/tests/generated/rounding_fractial_input_3.rs @@ -1,12 +1,14 @@ #[test] fn rounding_fractial_input_3() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,7 +18,7 @@ fn rounding_fractial_input_3() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -26,7 +28,7 @@ fn rounding_fractial_input_3() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -39,7 +41,7 @@ fn rounding_fractial_input_3() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(113.4f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -47,6 +49,9 @@ fn rounding_fractial_input_3() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 113f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/rounding_fractial_input_4.rs b/tests/generated/rounding_fractial_input_4.rs index 243725b43..9a2a2b804 100644 --- a/tests/generated/rounding_fractial_input_4.rs +++ b/tests/generated/rounding_fractial_input_4.rs @@ -1,12 +1,14 @@ #[test] fn rounding_fractial_input_4() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(50f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,7 +18,7 @@ fn rounding_fractial_input_4() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -26,7 +28,7 @@ fn rounding_fractial_input_4() { .new_with_children( taffy::style::Style { flex_grow: 1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -39,7 +41,7 @@ fn rounding_fractial_input_4() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(113.4f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -47,6 +49,9 @@ fn rounding_fractial_input_4() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 113f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/rounding_total_fractial.rs b/tests/generated/rounding_total_fractial.rs index a2bd44c01..11a8fca73 100644 --- a/tests/generated/rounding_total_fractial.rs +++ b/tests/generated/rounding_total_fractial.rs @@ -1,12 +1,14 @@ #[test] fn rounding_total_fractial() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( taffy::style::Style { flex_grow: 0.7f32, flex_basis: taffy::style::Dimension::Points(50.3f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20.3f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20.3f32), ..Size::auto() }, ..Default::default() }, &[], @@ -16,7 +18,7 @@ fn rounding_total_fractial() { .new_with_children( taffy::style::Style { flex_grow: 1.6f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -26,7 +28,7 @@ fn rounding_total_fractial() { .new_with_children( taffy::style::Style { flex_grow: 1.1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10.7f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10.7f32), ..Size::auto() }, ..Default::default() }, &[], @@ -39,7 +41,7 @@ fn rounding_total_fractial() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(87.4f32), height: taffy::style::Dimension::Points(113.4f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -47,6 +49,9 @@ fn rounding_total_fractial() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 87f32); assert_eq!(taffy.layout(node).unwrap().size.height, 113f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/rounding_total_fractial_nested.rs b/tests/generated/rounding_total_fractial_nested.rs index e9fa43e59..e8f3e1d35 100644 --- a/tests/generated/rounding_total_fractial_nested.rs +++ b/tests/generated/rounding_total_fractial_nested.rs @@ -1,15 +1,17 @@ #[test] fn rounding_total_fractial_nested() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( taffy::style::Style { flex_grow: 1f32, flex_basis: taffy::style::Dimension::Points(0.3f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(9.9f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(9.9f32), ..Size::auto() }, position: taffy::geometry::Rect { - bottom: taffy::style::Dimension::Points(13.3f32), - ..Default::default() + bottom: taffy::style::LengthPercentageAuto::Points(13.3f32), + ..Rect::auto() }, ..Default::default() }, @@ -21,8 +23,11 @@ fn rounding_total_fractial_nested() { taffy::style::Style { flex_grow: 4f32, flex_basis: taffy::style::Dimension::Points(0.3f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(1.1f32), ..Default::default() }, - position: taffy::geometry::Rect { top: taffy::style::Dimension::Points(13.3f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(1.1f32), ..Size::auto() }, + position: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(13.3f32), + ..Rect::auto() + }, ..Default::default() }, &[], @@ -34,7 +39,7 @@ fn rounding_total_fractial_nested() { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 0.7f32, flex_basis: taffy::style::Dimension::Points(50.3f32), - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20.3f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20.3f32), ..Size::auto() }, ..Default::default() }, &[node00, node01], @@ -44,7 +49,7 @@ fn rounding_total_fractial_nested() { .new_with_children( taffy::style::Style { flex_grow: 1.6f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[], @@ -54,7 +59,7 @@ fn rounding_total_fractial_nested() { .new_with_children( taffy::style::Style { flex_grow: 1.1f32, - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10.7f32), ..Default::default() }, + size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10.7f32), ..Size::auto() }, ..Default::default() }, &[], @@ -67,7 +72,7 @@ fn rounding_total_fractial_nested() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(87.4f32), height: taffy::style::Dimension::Points(113.4f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -75,6 +80,9 @@ fn rounding_total_fractial_nested() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 87f32); assert_eq!(taffy.layout(node).unwrap().size.height, 113f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/size_defined_by_child.rs b/tests/generated/size_defined_by_child.rs index 819245f1d..135e3b509 100644 --- a/tests/generated/size_defined_by_child.rs +++ b/tests/generated/size_defined_by_child.rs @@ -1,5 +1,7 @@ #[test] fn size_defined_by_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn size_defined_by_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -16,6 +18,9 @@ fn size_defined_by_child() { .unwrap(); let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node0]).unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/size_defined_by_child_with_border.rs b/tests/generated/size_defined_by_child_with_border.rs index 35373aac8..78f10c3b0 100644 --- a/tests/generated/size_defined_by_child_with_border.rs +++ b/tests/generated/size_defined_by_child_with_border.rs @@ -1,5 +1,7 @@ #[test] fn size_defined_by_child_with_border() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn size_defined_by_child_with_border() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -18,11 +20,11 @@ fn size_defined_by_child_with_border() { .new_with_children( taffy::style::Style { border: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -30,6 +32,9 @@ fn size_defined_by_child_with_border() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 30f32); assert_eq!(taffy.layout(node).unwrap().size.height, 30f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/size_defined_by_child_with_padding.rs b/tests/generated/size_defined_by_child_with_padding.rs index 39dede377..763f08c7a 100644 --- a/tests/generated/size_defined_by_child_with_padding.rs +++ b/tests/generated/size_defined_by_child_with_padding.rs @@ -1,5 +1,7 @@ #[test] fn size_defined_by_child_with_padding() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn size_defined_by_child_with_padding() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -18,11 +20,11 @@ fn size_defined_by_child_with_padding() { .new_with_children( taffy::style::Style { padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10f32), - right: taffy::style::Dimension::Points(10f32), - top: taffy::style::Dimension::Points(10f32), - bottom: taffy::style::Dimension::Points(10f32), - ..Default::default() + left: taffy::style::LengthPercentage::Points(10f32), + right: taffy::style::LengthPercentage::Points(10f32), + top: taffy::style::LengthPercentage::Points(10f32), + bottom: taffy::style::LengthPercentage::Points(10f32), + ..Rect::zero() }, ..Default::default() }, @@ -30,6 +32,9 @@ fn size_defined_by_child_with_padding() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 30f32); assert_eq!(taffy.layout(node).unwrap().size.height, 30f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/size_defined_by_grand_child.rs b/tests/generated/size_defined_by_grand_child.rs index 01c97e36f..b2182c4e0 100644 --- a/tests/generated/size_defined_by_grand_child.rs +++ b/tests/generated/size_defined_by_grand_child.rs @@ -1,5 +1,7 @@ #[test] fn size_defined_by_grand_child() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn size_defined_by_grand_child() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -17,6 +19,9 @@ fn size_defined_by_grand_child() { let node0 = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node00]).unwrap(); let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node0]).unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/width_smaller_then_content_with_flex_grow_large_size.rs b/tests/generated/width_smaller_then_content_with_flex_grow_large_size.rs index 12e442fb2..36322f1ce 100644 --- a/tests/generated/width_smaller_then_content_with_flex_grow_large_size.rs +++ b/tests/generated/width_smaller_then_content_with_flex_grow_large_size.rs @@ -1,5 +1,7 @@ #[test] fn width_smaller_then_content_with_flex_grow_large_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn width_smaller_then_content_with_flex_grow_large_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ fn width_smaller_then_content_with_flex_grow_large_size() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node00], @@ -31,7 +33,7 @@ fn width_smaller_then_content_with_flex_grow_large_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,7 +45,7 @@ fn width_smaller_then_content_with_flex_grow_large_size() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node10], @@ -52,13 +54,16 @@ fn width_smaller_then_content_with_flex_grow_large_size() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/width_smaller_then_content_with_flex_grow_small_size.rs b/tests/generated/width_smaller_then_content_with_flex_grow_small_size.rs index 421ff8369..7b43ccc18 100644 --- a/tests/generated/width_smaller_then_content_with_flex_grow_small_size.rs +++ b/tests/generated/width_smaller_then_content_with_flex_grow_small_size.rs @@ -1,5 +1,7 @@ #[test] fn width_smaller_then_content_with_flex_grow_small_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn width_smaller_then_content_with_flex_grow_small_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ fn width_smaller_then_content_with_flex_grow_small_size() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node00], @@ -31,7 +33,7 @@ fn width_smaller_then_content_with_flex_grow_small_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,7 +45,7 @@ fn width_smaller_then_content_with_flex_grow_small_size() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node10], @@ -52,13 +54,16 @@ fn width_smaller_then_content_with_flex_grow_small_size() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 10f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/width_smaller_then_content_with_flex_grow_unconstraint_size.rs b/tests/generated/width_smaller_then_content_with_flex_grow_unconstraint_size.rs index 5db102eed..6270a02df 100644 --- a/tests/generated/width_smaller_then_content_with_flex_grow_unconstraint_size.rs +++ b/tests/generated/width_smaller_then_content_with_flex_grow_unconstraint_size.rs @@ -1,5 +1,7 @@ #[test] fn width_smaller_then_content_with_flex_grow_unconstraint_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn width_smaller_then_content_with_flex_grow_unconstraint_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ fn width_smaller_then_content_with_flex_grow_unconstraint_size() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node00], @@ -31,7 +33,7 @@ fn width_smaller_then_content_with_flex_grow_unconstraint_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,7 +45,7 @@ fn width_smaller_then_content_with_flex_grow_unconstraint_size() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node10], @@ -51,6 +53,9 @@ fn width_smaller_then_content_with_flex_grow_unconstraint_size() { .unwrap(); let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node0, node1]).unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 0f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/width_smaller_then_content_with_flex_grow_very_large_size.rs b/tests/generated/width_smaller_then_content_with_flex_grow_very_large_size.rs index d8cf45347..4f24585b3 100644 --- a/tests/generated/width_smaller_then_content_with_flex_grow_very_large_size.rs +++ b/tests/generated/width_smaller_then_content_with_flex_grow_very_large_size.rs @@ -1,5 +1,7 @@ #[test] fn width_smaller_then_content_with_flex_grow_very_large_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn width_smaller_then_content_with_flex_grow_very_large_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -19,7 +21,7 @@ fn width_smaller_then_content_with_flex_grow_very_large_size() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node00], @@ -31,7 +33,7 @@ fn width_smaller_then_content_with_flex_grow_very_large_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -43,7 +45,7 @@ fn width_smaller_then_content_with_flex_grow_very_large_size() { taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, flex_grow: 1f32, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(0f32), ..Size::auto() }, ..Default::default() }, &[node10], @@ -52,13 +54,16 @@ fn width_smaller_then_content_with_flex_grow_very_large_size() { let node = taffy .new_with_children( taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[node0, node1], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrap_column.rs b/tests/generated/wrap_column.rs index fcf7dc03c..dc853278c 100644 --- a/tests/generated/wrap_column.rs +++ b/tests/generated/wrap_column.rs @@ -1,5 +1,7 @@ #[test] fn wrap_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrap_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(31f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn wrap_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(32f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn wrap_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(33f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn wrap_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(34f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -61,7 +63,7 @@ fn wrap_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -69,6 +71,9 @@ fn wrap_column() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrap_nodes_with_content_sizing_margin_cross.rs b/tests/generated/wrap_nodes_with_content_sizing_margin_cross.rs index e23464ecb..a481c46ef 100644 --- a/tests/generated/wrap_nodes_with_content_sizing_margin_cross.rs +++ b/tests/generated/wrap_nodes_with_content_sizing_margin_cross.rs @@ -1,5 +1,7 @@ #[test] fn wrap_nodes_with_content_sizing_margin_cross() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrap_nodes_with_content_sizing_margin_cross() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(40f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -26,7 +28,7 @@ fn wrap_nodes_with_content_sizing_margin_cross() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(40f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -37,7 +39,10 @@ fn wrap_nodes_with_content_sizing_margin_cross() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - margin: taffy::geometry::Rect { top: taffy::style::Dimension::Points(10f32), ..Default::default() }, + margin: taffy::geometry::Rect { + top: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[node010], @@ -47,7 +52,7 @@ fn wrap_nodes_with_content_sizing_margin_cross() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(70f32), ..Size::auto() }, ..Default::default() }, &[node00, node01], @@ -60,7 +65,7 @@ fn wrap_nodes_with_content_sizing_margin_cross() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -68,6 +73,9 @@ fn wrap_nodes_with_content_sizing_margin_cross() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 500f32); assert_eq!(taffy.layout(node).unwrap().size.height, 500f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrap_nodes_with_content_sizing_overflowing_margin.rs b/tests/generated/wrap_nodes_with_content_sizing_overflowing_margin.rs index 6360d325f..daaa1c5d3 100644 --- a/tests/generated/wrap_nodes_with_content_sizing_overflowing_margin.rs +++ b/tests/generated/wrap_nodes_with_content_sizing_overflowing_margin.rs @@ -1,5 +1,7 @@ #[test] fn wrap_nodes_with_content_sizing_overflowing_margin() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node000 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrap_nodes_with_content_sizing_overflowing_margin() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(40f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -26,7 +28,7 @@ fn wrap_nodes_with_content_sizing_overflowing_margin() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(40f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -37,7 +39,10 @@ fn wrap_nodes_with_content_sizing_overflowing_margin() { .new_with_children( taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, - margin: taffy::geometry::Rect { right: taffy::style::Dimension::Points(10f32), ..Default::default() }, + margin: taffy::geometry::Rect { + right: taffy::style::LengthPercentageAuto::Points(10f32), + ..Rect::zero() + }, ..Default::default() }, &[node010], @@ -47,7 +52,7 @@ fn wrap_nodes_with_content_sizing_overflowing_margin() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(85f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(85f32), ..Size::auto() }, ..Default::default() }, &[node00, node01], @@ -60,7 +65,7 @@ fn wrap_nodes_with_content_sizing_overflowing_margin() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(500f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -68,6 +73,9 @@ fn wrap_nodes_with_content_sizing_overflowing_margin() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 500f32); assert_eq!(taffy.layout(node).unwrap().size.height, 500f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrap_reverse_column.rs b/tests/generated/wrap_reverse_column.rs index 57f0765b2..ca309237a 100644 --- a/tests/generated/wrap_reverse_column.rs +++ b/tests/generated/wrap_reverse_column.rs @@ -1,5 +1,7 @@ #[test] fn wrap_reverse_column() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrap_reverse_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(31f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn wrap_reverse_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(32f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn wrap_reverse_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(33f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn wrap_reverse_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(34f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -61,7 +63,7 @@ fn wrap_reverse_column() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -69,6 +71,9 @@ fn wrap_reverse_column() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrap_reverse_column_fixed_size.rs b/tests/generated/wrap_reverse_column_fixed_size.rs index 064d9acb4..3c0aa9dfd 100644 --- a/tests/generated/wrap_reverse_column_fixed_size.rs +++ b/tests/generated/wrap_reverse_column_fixed_size.rs @@ -1,5 +1,7 @@ #[test] fn wrap_reverse_column_fixed_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrap_reverse_column_fixed_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn wrap_reverse_column_fixed_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn wrap_reverse_column_fixed_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn wrap_reverse_column_fixed_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn wrap_reverse_column_fixed_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -75,7 +77,7 @@ fn wrap_reverse_column_fixed_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -83,6 +85,9 @@ fn wrap_reverse_column_fixed_size() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 100f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrap_reverse_row.rs b/tests/generated/wrap_reverse_row.rs index 88c2347c9..ac5bbc569 100644 --- a/tests/generated/wrap_reverse_row.rs +++ b/tests/generated/wrap_reverse_row.rs @@ -1,5 +1,7 @@ #[test] fn wrap_reverse_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrap_reverse_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(31f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn wrap_reverse_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(32f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn wrap_reverse_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(33f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn wrap_reverse_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(34f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -57,13 +59,16 @@ fn wrap_reverse_row() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::WrapReverse, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 60f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrap_reverse_row_align_content_center.rs b/tests/generated/wrap_reverse_row_align_content_center.rs index b1904e337..b5939f7cf 100644 --- a/tests/generated/wrap_reverse_row_align_content_center.rs +++ b/tests/generated/wrap_reverse_row_align_content_center.rs @@ -1,5 +1,7 @@ #[test] fn wrap_reverse_row_align_content_center() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrap_reverse_row_align_content_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn wrap_reverse_row_align_content_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn wrap_reverse_row_align_content_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn wrap_reverse_row_align_content_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn wrap_reverse_row_align_content_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,13 +73,16 @@ fn wrap_reverse_row_align_content_center() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::WrapReverse, align_content: taffy::style::AlignContent::Center, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3, node4], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 80f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrap_reverse_row_align_content_flex_start.rs b/tests/generated/wrap_reverse_row_align_content_flex_start.rs index 90a80c195..b4a8c871b 100644 --- a/tests/generated/wrap_reverse_row_align_content_flex_start.rs +++ b/tests/generated/wrap_reverse_row_align_content_flex_start.rs @@ -1,5 +1,7 @@ #[test] fn wrap_reverse_row_align_content_flex_start() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrap_reverse_row_align_content_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn wrap_reverse_row_align_content_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn wrap_reverse_row_align_content_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn wrap_reverse_row_align_content_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn wrap_reverse_row_align_content_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,13 +73,16 @@ fn wrap_reverse_row_align_content_flex_start() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::WrapReverse, align_content: taffy::style::AlignContent::FlexStart, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3, node4], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 80f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrap_reverse_row_align_content_space_around.rs b/tests/generated/wrap_reverse_row_align_content_space_around.rs index ec94b1d6d..b508dc918 100644 --- a/tests/generated/wrap_reverse_row_align_content_space_around.rs +++ b/tests/generated/wrap_reverse_row_align_content_space_around.rs @@ -1,5 +1,7 @@ #[test] fn wrap_reverse_row_align_content_space_around() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrap_reverse_row_align_content_space_around() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn wrap_reverse_row_align_content_space_around() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn wrap_reverse_row_align_content_space_around() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn wrap_reverse_row_align_content_space_around() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn wrap_reverse_row_align_content_space_around() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,13 +73,16 @@ fn wrap_reverse_row_align_content_space_around() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::WrapReverse, align_content: taffy::style::AlignContent::SpaceAround, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3, node4], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 80f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrap_reverse_row_align_content_stretch.rs b/tests/generated/wrap_reverse_row_align_content_stretch.rs index 92227e738..f5b761bfa 100644 --- a/tests/generated/wrap_reverse_row_align_content_stretch.rs +++ b/tests/generated/wrap_reverse_row_align_content_stretch.rs @@ -1,5 +1,7 @@ #[test] fn wrap_reverse_row_align_content_stretch() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrap_reverse_row_align_content_stretch() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn wrap_reverse_row_align_content_stretch() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn wrap_reverse_row_align_content_stretch() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn wrap_reverse_row_align_content_stretch() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn wrap_reverse_row_align_content_stretch() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -70,13 +72,16 @@ fn wrap_reverse_row_align_content_stretch() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::WrapReverse, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3, node4], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 80f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrap_reverse_row_single_line_different_size.rs b/tests/generated/wrap_reverse_row_single_line_different_size.rs index 814a1db77..db6054f7e 100644 --- a/tests/generated/wrap_reverse_row_single_line_different_size.rs +++ b/tests/generated/wrap_reverse_row_single_line_different_size.rs @@ -1,5 +1,7 @@ #[test] fn wrap_reverse_row_single_line_different_size() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrap_reverse_row_single_line_different_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn wrap_reverse_row_single_line_different_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn wrap_reverse_row_single_line_different_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn wrap_reverse_row_single_line_different_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(40f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -59,7 +61,7 @@ fn wrap_reverse_row_single_line_different_size() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(50f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -71,13 +73,16 @@ fn wrap_reverse_row_single_line_different_size() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::WrapReverse, align_content: taffy::style::AlignContent::FlexStart, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(300f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(300f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3, node4], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 300f32); assert_eq!(taffy.layout(node).unwrap().size.height, 50f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrap_row.rs b/tests/generated/wrap_row.rs index facf62294..9c1bfa932 100644 --- a/tests/generated/wrap_row.rs +++ b/tests/generated/wrap_row.rs @@ -1,5 +1,7 @@ #[test] fn wrap_row() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrap_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(31f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn wrap_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(32f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn wrap_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(33f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn wrap_row() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(34f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -57,13 +59,16 @@ fn wrap_row() { .new_with_children( taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 60f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrap_row_align_items_center.rs b/tests/generated/wrap_row_align_items_center.rs index 4b4b070fd..d8f28975c 100644 --- a/tests/generated/wrap_row_align_items_center.rs +++ b/tests/generated/wrap_row_align_items_center.rs @@ -1,5 +1,7 @@ #[test] fn wrap_row_align_items_center() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrap_row_align_items_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn wrap_row_align_items_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn wrap_row_align_items_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn wrap_row_align_items_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,13 +60,16 @@ fn wrap_row_align_items_center() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, align_items: taffy::style::AlignItems::Center, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 60f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrap_row_align_items_flex_end.rs b/tests/generated/wrap_row_align_items_flex_end.rs index 5cfc053d6..e753ce6f7 100644 --- a/tests/generated/wrap_row_align_items_flex_end.rs +++ b/tests/generated/wrap_row_align_items_flex_end.rs @@ -1,5 +1,7 @@ #[test] fn wrap_row_align_items_flex_end() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrap_row_align_items_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(10f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn wrap_row_align_items_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(20f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -33,7 +35,7 @@ fn wrap_row_align_items_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -46,7 +48,7 @@ fn wrap_row_align_items_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(30f32), height: taffy::style::Dimension::Points(30f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -58,13 +60,16 @@ fn wrap_row_align_items_flex_end() { taffy::style::Style { flex_wrap: taffy::style::FlexWrap::Wrap, align_items: taffy::style::AlignItems::FlexEnd, - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Default::default() }, + size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() }, ..Default::default() }, &[node0, node1, node2, node3], ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 100f32); assert_eq!(taffy.layout(node).unwrap().size.height, 60f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrapped_column_max_height.rs b/tests/generated/wrapped_column_max_height.rs index 13b6da18f..03b88cad4 100644 --- a/tests/generated/wrapped_column_max_height.rs +++ b/tests/generated/wrapped_column_max_height.rs @@ -1,5 +1,7 @@ #[test] fn wrapped_column_max_height() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -7,12 +9,9 @@ fn wrapped_column_max_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[], @@ -24,14 +23,14 @@ fn wrapped_column_max_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(20f32), - right: taffy::style::Dimension::Points(20f32), - top: taffy::style::Dimension::Points(20f32), - bottom: taffy::style::Dimension::Points(20f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(20f32), + right: taffy::style::LengthPercentageAuto::Points(20f32), + top: taffy::style::LengthPercentageAuto::Points(20f32), + bottom: taffy::style::LengthPercentageAuto::Points(20f32), + ..Rect::zero() }, ..Default::default() }, @@ -44,7 +43,7 @@ fn wrapped_column_max_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -62,7 +61,7 @@ fn wrapped_column_max_height() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(700f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -70,6 +69,9 @@ fn wrapped_column_max_height() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 700f32); assert_eq!(taffy.layout(node).unwrap().size.height, 500f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrapped_column_max_height_flex.rs b/tests/generated/wrapped_column_max_height_flex.rs index f1772b525..504c97f8b 100644 --- a/tests/generated/wrapped_column_max_height_flex.rs +++ b/tests/generated/wrapped_column_max_height_flex.rs @@ -1,5 +1,7 @@ #[test] fn wrapped_column_max_height_flex() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node0 = taffy .new_with_children( @@ -10,12 +12,9 @@ fn wrapped_column_max_height_flex() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() - }, - max_size: taffy::geometry::Size { - height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, + max_size: taffy::geometry::Size { height: taffy::style::Dimension::Points(200f32), ..Size::auto() }, ..Default::default() }, &[], @@ -30,14 +29,14 @@ fn wrapped_column_max_height_flex() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, margin: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(20f32), - right: taffy::style::Dimension::Points(20f32), - top: taffy::style::Dimension::Points(20f32), - bottom: taffy::style::Dimension::Points(20f32), - ..Default::default() + left: taffy::style::LengthPercentageAuto::Points(20f32), + right: taffy::style::LengthPercentageAuto::Points(20f32), + top: taffy::style::LengthPercentageAuto::Points(20f32), + bottom: taffy::style::LengthPercentageAuto::Points(20f32), + ..Rect::zero() }, ..Default::default() }, @@ -50,7 +49,7 @@ fn wrapped_column_max_height_flex() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), height: taffy::style::Dimension::Points(100f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -68,7 +67,7 @@ fn wrapped_column_max_height_flex() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(700f32), height: taffy::style::Dimension::Points(500f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -76,6 +75,9 @@ fn wrapped_column_max_height_flex() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 700f32); assert_eq!(taffy.layout(node).unwrap().size.height, 500f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrapped_row_within_align_items_center.rs b/tests/generated/wrapped_row_within_align_items_center.rs index d1d41fcae..2eb4dfea2 100644 --- a/tests/generated/wrapped_row_within_align_items_center.rs +++ b/tests/generated/wrapped_row_within_align_items_center.rs @@ -1,5 +1,7 @@ #[test] fn wrapped_row_within_align_items_center() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrapped_row_within_align_items_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(150f32), height: taffy::style::Dimension::Points(80f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn wrapped_row_within_align_items_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), height: taffy::style::Dimension::Points(80f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -41,7 +43,7 @@ fn wrapped_row_within_align_items_center() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -49,6 +51,9 @@ fn wrapped_row_within_align_items_center() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrapped_row_within_align_items_flex_end.rs b/tests/generated/wrapped_row_within_align_items_flex_end.rs index 822843e00..b42c303b5 100644 --- a/tests/generated/wrapped_row_within_align_items_flex_end.rs +++ b/tests/generated/wrapped_row_within_align_items_flex_end.rs @@ -1,5 +1,7 @@ #[test] fn wrapped_row_within_align_items_flex_end() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrapped_row_within_align_items_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(150f32), height: taffy::style::Dimension::Points(80f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn wrapped_row_within_align_items_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), height: taffy::style::Dimension::Points(80f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -41,7 +43,7 @@ fn wrapped_row_within_align_items_flex_end() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -49,6 +51,9 @@ fn wrapped_row_within_align_items_flex_end() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/generated/wrapped_row_within_align_items_flex_start.rs b/tests/generated/wrapped_row_within_align_items_flex_start.rs index 5ff00f0e8..27c8f9e25 100644 --- a/tests/generated/wrapped_row_within_align_items_flex_start.rs +++ b/tests/generated/wrapped_row_within_align_items_flex_start.rs @@ -1,5 +1,7 @@ #[test] fn wrapped_row_within_align_items_flex_start() { + #[allow(unused_imports)] + use taffy::prelude::*; let mut taffy = taffy::Taffy::new(); let node00 = taffy .new_with_children( @@ -7,7 +9,7 @@ fn wrapped_row_within_align_items_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(150f32), height: taffy::style::Dimension::Points(80f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -20,7 +22,7 @@ fn wrapped_row_within_align_items_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(80f32), height: taffy::style::Dimension::Points(80f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -41,7 +43,7 @@ fn wrapped_row_within_align_items_flex_start() { size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), height: taffy::style::Dimension::Points(200f32), - ..Default::default() + ..Size::auto() }, ..Default::default() }, @@ -49,6 +51,9 @@ fn wrapped_row_within_align_items_flex_start() { ) .unwrap(); taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + println!("\nComputed tree:"); + taffy::debug::print_tree(&taffy, node); + println!(); assert_eq!(taffy.layout(node).unwrap().size.width, 200f32); assert_eq!(taffy.layout(node).unwrap().size.height, 200f32); assert_eq!(taffy.layout(node).unwrap().location.x, 0f32); diff --git a/tests/measure.rs b/tests/measure.rs index 7f8c6e4e3..8ff8e8134 100644 --- a/tests/measure.rs +++ b/tests/measure.rs @@ -1,21 +1,22 @@ #[cfg(test)] mod measure { use taffy::node::MeasureFunc; + use taffy::prelude::*; #[test] fn measure_root() { - let mut taffy = taffy::node::Taffy::new(); + let mut taffy = Taffy::new(); let node = taffy .new_leaf_with_measure( - taffy::style::Style { ..Default::default() }, - MeasureFunc::Raw(|known_dimensions, _available_space| taffy::geometry::Size { + Style { ..Default::default() }, + MeasureFunc::Raw(|known_dimensions, _available_space| Size { width: known_dimensions.width.unwrap_or(100.0), height: known_dimensions.height.unwrap_or(100.0), }), ) .unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(taffy.layout(node).unwrap().size.width, 100.0); assert_eq!(taffy.layout(node).unwrap().size.height, 100.0); @@ -23,20 +24,20 @@ mod measure { #[test] fn measure_child() { - let mut taffy = taffy::node::Taffy::new(); + let mut taffy = Taffy::new(); let child = taffy .new_leaf_with_measure( - taffy::style::Style { ..Default::default() }, - MeasureFunc::Raw(|known_dimensions, _available_space| taffy::geometry::Size { + Style { ..Default::default() }, + MeasureFunc::Raw(|known_dimensions, _available_space| Size { width: known_dimensions.width.unwrap_or(100.0), height: known_dimensions.height.unwrap_or(100.0), }), ) .unwrap(); - let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[child]).unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + let node = taffy.new_with_children(Style { ..Default::default() }, &[child]).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(taffy.layout(node).unwrap().size.width, 100.0); assert_eq!(taffy.layout(node).unwrap().size.height, 100.0); @@ -47,11 +48,11 @@ mod measure { #[test] fn measure_child_constraint() { - let mut taffy = taffy::node::Taffy::new(); + let mut taffy = Taffy::new(); let child = taffy .new_leaf_with_measure( - taffy::style::Style { ..Default::default() }, - MeasureFunc::Raw(|known_dimensions, _available_space| taffy::geometry::Size { + Style { ..Default::default() }, + MeasureFunc::Raw(|known_dimensions, _available_space| Size { width: known_dimensions.width.unwrap_or(100.0), height: known_dimensions.height.unwrap_or(100.0), }), @@ -60,15 +61,12 @@ mod measure { let node = taffy .new_with_children( - taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50.0), ..Default::default() }, - ..Default::default() - }, + Style { size: Size { width: Dimension::Points(50.0), height: auto() }, ..Default::default() }, &[child], ) .unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(taffy.layout(node).unwrap().size.width, 50.0); assert_eq!(taffy.layout(node).unwrap().size.height, 100.0); @@ -79,11 +77,11 @@ mod measure { #[test] fn measure_child_constraint_padding_parent() { - let mut taffy = taffy::node::Taffy::new(); + let mut taffy = Taffy::new(); let child = taffy .new_leaf_with_measure( - taffy::style::Style { ..Default::default() }, - MeasureFunc::Raw(|known_dimensions, _available_space| taffy::geometry::Size { + Style { ..Default::default() }, + MeasureFunc::Raw(|known_dimensions, _available_space| Size { width: known_dimensions.width.unwrap_or(100.0), height: known_dimensions.height.unwrap_or(100.0), }), @@ -92,20 +90,20 @@ mod measure { let node = taffy .new_with_children( - taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50.0), ..Default::default() }, - padding: taffy::geometry::Rect { - left: taffy::style::Dimension::Points(10.0), - right: taffy::style::Dimension::Points(10.0), - top: taffy::style::Dimension::Points(10.0), - bottom: taffy::style::Dimension::Points(10.0), + Style { + size: Size { width: Dimension::Points(50.0), height: auto() }, + padding: Rect { + left: LengthPercentage::Points(10.0), + right: LengthPercentage::Points(10.0), + top: LengthPercentage::Points(10.0), + bottom: LengthPercentage::Points(10.0), }, ..Default::default() }, &[child], ) .unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(taffy.layout(node).unwrap().size.width, 50.0); assert_eq!(taffy.layout(node).unwrap().size.height, 120.0); @@ -116,21 +114,18 @@ mod measure { #[test] fn measure_child_with_flex_grow() { - let mut taffy = taffy::node::Taffy::new(); + let mut taffy = Taffy::new(); let child0 = taffy - .new_leaf(taffy::style::Style { - size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(50.0), - height: taffy::style::Dimension::Points(50.0), - }, + .new_leaf(Style { + size: Size { width: Dimension::Points(50.0), height: Dimension::Points(50.0) }, ..Default::default() }) .unwrap(); let child1 = taffy .new_leaf_with_measure( - taffy::style::Style { flex_grow: 1.0, ..Default::default() }, - MeasureFunc::Raw(|known_dimensions, _available_space| taffy::geometry::Size { + Style { flex_grow: 1.0, ..Default::default() }, + MeasureFunc::Raw(|known_dimensions, _available_space| Size { width: known_dimensions.width.unwrap_or(10.0), height: known_dimensions.height.unwrap_or(50.0), }), @@ -139,15 +134,12 @@ mod measure { let node = taffy .new_with_children( - taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100.0), ..Default::default() }, - ..Default::default() - }, + Style { size: Size { width: Dimension::Points(100.0), height: auto() }, ..Default::default() }, &[child0, child1], ) .unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(taffy.layout(child1).unwrap().size.width, 50.0); assert_eq!(taffy.layout(child1).unwrap().size.height, 50.0); @@ -155,13 +147,10 @@ mod measure { #[test] fn measure_child_with_flex_shrink() { - let mut taffy = taffy::node::Taffy::new(); + let mut taffy = Taffy::new(); let child0 = taffy - .new_leaf(taffy::style::Style { - size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(50.0), - height: taffy::style::Dimension::Points(50.0), - }, + .new_leaf(Style { + size: Size { width: Dimension::Points(50.0), height: Dimension::Points(50.0) }, flex_shrink: 0.0, ..Default::default() }) @@ -169,8 +158,8 @@ mod measure { let child1 = taffy .new_leaf_with_measure( - taffy::style::Style { ..Default::default() }, - MeasureFunc::Raw(|known_dimensions, _available_space| taffy::geometry::Size { + Style { ..Default::default() }, + MeasureFunc::Raw(|known_dimensions, _available_space| Size { width: known_dimensions.width.unwrap_or(100.0), height: known_dimensions.height.unwrap_or(50.0), }), @@ -179,15 +168,12 @@ mod measure { let node = taffy .new_with_children( - taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100.0), ..Default::default() }, - ..Default::default() - }, + Style { size: Size { width: Dimension::Points(100.0), height: auto() }, ..Default::default() }, &[child0, child1], ) .unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(taffy.layout(child1).unwrap().size.width, 50.0); assert_eq!(taffy.layout(child1).unwrap().size.height, 50.0); @@ -195,40 +181,37 @@ mod measure { #[test] fn remeasure_child_after_growing() { - let mut taffy = taffy::node::Taffy::new(); + let mut taffy = Taffy::new(); let child0 = taffy - .new_leaf(taffy::style::Style { - size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(50.0), - height: taffy::style::Dimension::Points(50.0), - }, + .new_leaf(Style { + size: Size { width: Dimension::Points(50.0), height: Dimension::Points(50.0) }, ..Default::default() }) .unwrap(); let child1 = taffy .new_leaf_with_measure( - taffy::style::Style { flex_grow: 1.0, ..Default::default() }, + Style { flex_grow: 1.0, ..Default::default() }, MeasureFunc::Raw(|known_dimensions, _available_space| { let width = known_dimensions.width.unwrap_or(10.0); let height = known_dimensions.height.unwrap_or(width * 2.0); - taffy::geometry::Size { width, height } + Size { width, height } }), ) .unwrap(); let node = taffy .new_with_children( - taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100.0), ..Default::default() }, - align_items: taffy::style::AlignItems::FlexStart, + Style { + size: Size { width: Dimension::Points(100.0), height: auto() }, + align_items: AlignItems::FlexStart, ..Default::default() }, &[child0, child1], ) .unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(taffy.layout(child1).unwrap().size.width, 50.0); assert_eq!(taffy.layout(child1).unwrap().size.height, 100.0); @@ -236,14 +219,11 @@ mod measure { #[test] fn remeasure_child_after_shrinking() { - let mut taffy = taffy::node::Taffy::new(); + let mut taffy = Taffy::new(); let child0 = taffy - .new_leaf(taffy::style::Style { - size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(50.0), - height: taffy::style::Dimension::Points(50.0), - }, + .new_leaf(Style { + size: Size { width: Dimension::Points(50.0), height: Dimension::Points(50.0) }, flex_shrink: 0.0, ..Default::default() }) @@ -251,27 +231,27 @@ mod measure { let child1 = taffy .new_leaf_with_measure( - taffy::style::Style { ..Default::default() }, + Style { ..Default::default() }, MeasureFunc::Raw(|known_dimensions, _available_space| { let width = known_dimensions.width.unwrap_or(100.0); let height = known_dimensions.height.unwrap_or(width * 2.0); - taffy::geometry::Size { width, height } + Size { width, height } }), ) .unwrap(); let node = taffy .new_with_children( - taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100.0), ..Default::default() }, - align_items: taffy::style::AlignItems::FlexStart, + Style { + size: Size { width: Dimension::Points(100.0), height: auto() }, + align_items: AlignItems::FlexStart, ..Default::default() }, &[child0, child1], ) .unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(taffy.layout(child1).unwrap().size.width, 50.0); assert_eq!(taffy.layout(child1).unwrap().size.height, 100.0); @@ -279,33 +259,30 @@ mod measure { #[test] fn remeasure_child_after_stretching() { - let mut taffy = taffy::node::Taffy::new(); + let mut taffy = Taffy::new(); let child = taffy .new_leaf_with_measure( - taffy::style::Style { ..Default::default() }, + Style { ..Default::default() }, MeasureFunc::Raw(|known_dimensions, _available_space| { let height = known_dimensions.height.unwrap_or(50.0); let width = known_dimensions.width.unwrap_or(height); - taffy::geometry::Size { width, height } + Size { width, height } }), ) .unwrap(); let node = taffy .new_with_children( - taffy::style::Style { - size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100.0), - height: taffy::style::Dimension::Points(100.0), - }, + Style { + size: Size { width: Dimension::Points(100.0), height: Dimension::Points(100.0) }, ..Default::default() }, &[child], ) .unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(taffy.layout(child).unwrap().size.width, 100.0); assert_eq!(taffy.layout(child).unwrap().size.height, 100.0); @@ -313,22 +290,19 @@ mod measure { #[test] fn width_overrides_measure() { - let mut taffy = taffy::node::Taffy::new(); + let mut taffy = Taffy::new(); let child = taffy .new_leaf_with_measure( - taffy::style::Style { - size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50.0), ..Default::default() }, - ..Default::default() - }, - MeasureFunc::Raw(|known_dimensions, _available_space| taffy::geometry::Size { + Style { size: Size { width: Dimension::Points(50.0), height: auto() }, ..Default::default() }, + MeasureFunc::Raw(|known_dimensions, _available_space| Size { width: known_dimensions.width.unwrap_or(100.0), height: known_dimensions.height.unwrap_or(100.0), }), ) .unwrap(); - let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[child]).unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + let node = taffy.new_with_children(Style { ..Default::default() }, &[child]).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(taffy.layout(child).unwrap().size.width, 50.0); assert_eq!(taffy.layout(child).unwrap().size.height, 100.0); @@ -336,22 +310,19 @@ mod measure { #[test] fn height_overrides_measure() { - let mut taffy = taffy::node::Taffy::new(); + let mut taffy = Taffy::new(); let child = taffy .new_leaf_with_measure( - taffy::style::Style { - size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50.0), ..Default::default() }, - ..Default::default() - }, - MeasureFunc::Raw(|known_dimensions, _available_space| taffy::geometry::Size { + Style { size: Size { width: auto(), height: Dimension::Points(50.0) }, ..Default::default() }, + MeasureFunc::Raw(|known_dimensions, _available_space| Size { width: known_dimensions.width.unwrap_or(100.0), height: known_dimensions.height.unwrap_or(100.0), }), ) .unwrap(); - let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[child]).unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + let node = taffy.new_with_children(Style { ..Default::default() }, &[child]).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(taffy.layout(child).unwrap().size.width, 100.0); assert_eq!(taffy.layout(child).unwrap().size.height, 50.0); @@ -359,23 +330,15 @@ mod measure { #[test] fn flex_basis_overrides_measure() { - let mut taffy = taffy::node::Taffy::new(); + let mut taffy = Taffy::new(); let child0 = taffy - .new_leaf(taffy::style::Style { - flex_basis: taffy::style::Dimension::Points(50.0), - flex_grow: 1.0, - ..Default::default() - }) + .new_leaf(Style { flex_basis: Dimension::Points(50.0), flex_grow: 1.0, ..Default::default() }) .unwrap(); let child1 = taffy .new_leaf_with_measure( - taffy::style::Style { - flex_basis: taffy::style::Dimension::Points(50.0), - flex_grow: 1.0, - ..Default::default() - }, - MeasureFunc::Raw(|known_dimensions, _available_space| taffy::geometry::Size { + Style { flex_basis: Dimension::Points(50.0), flex_grow: 1.0, ..Default::default() }, + MeasureFunc::Raw(|known_dimensions, _available_space| Size { width: known_dimensions.width.unwrap_or(100.0), height: known_dimensions.height.unwrap_or(100.0), }), @@ -384,18 +347,15 @@ mod measure { let node = taffy .new_with_children( - taffy::style::Style { - size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(200.0), - height: taffy::style::Dimension::Points(100.0), - }, + Style { + size: Size { width: Dimension::Points(200.0), height: Dimension::Points(100.0) }, ..Default::default() }, &[child0, child1], ) .unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(taffy.layout(child0).unwrap().size.width, 100.0); assert_eq!(taffy.layout(child0).unwrap().size.height, 100.0); @@ -405,11 +365,11 @@ mod measure { #[test] fn stretch_overrides_measure() { - let mut taffy = taffy::node::Taffy::new(); + let mut taffy = Taffy::new(); let child = taffy .new_leaf_with_measure( - taffy::style::Style { ..Default::default() }, - MeasureFunc::Raw(|known_dimensions, _available_space| taffy::geometry::Size { + Style { ..Default::default() }, + MeasureFunc::Raw(|known_dimensions, _available_space| Size { width: known_dimensions.width.unwrap_or(50.0), height: known_dimensions.height.unwrap_or(50.0), }), @@ -418,18 +378,15 @@ mod measure { let node = taffy .new_with_children( - taffy::style::Style { - size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100.0), - height: taffy::style::Dimension::Points(100.0), - }, + Style { + size: Size { width: Dimension::Points(100.0), height: Dimension::Points(100.0) }, ..Default::default() }, &[child], ) .unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(taffy.layout(child).unwrap().size.width, 50.0); assert_eq!(taffy.layout(child).unwrap().size.height, 100.0); @@ -437,11 +394,11 @@ mod measure { #[test] fn measure_absolute_child() { - let mut taffy = taffy::node::Taffy::new(); + let mut taffy = Taffy::new(); let child = taffy .new_leaf_with_measure( - taffy::style::Style { position_type: taffy::style::PositionType::Absolute, ..Default::default() }, - MeasureFunc::Raw(|known_dimensions, _available_space| taffy::geometry::Size { + Style { position_type: PositionType::Absolute, ..Default::default() }, + MeasureFunc::Raw(|known_dimensions, _available_space| Size { width: known_dimensions.width.unwrap_or(50.0), height: known_dimensions.height.unwrap_or(50.0), }), @@ -450,18 +407,15 @@ mod measure { let node = taffy .new_with_children( - taffy::style::Style { - size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100.0), - height: taffy::style::Dimension::Points(100.0), - }, + Style { + size: Size { width: Dimension::Points(100.0), height: Dimension::Points(100.0) }, ..Default::default() }, &[child], ) .unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(taffy.layout(child).unwrap().size.width, 50.0); assert_eq!(taffy.layout(child).unwrap().size.height, 50.0); @@ -469,23 +423,20 @@ mod measure { #[test] fn ignore_invalid_measure() { - let mut taffy = taffy::node::Taffy::new(); - let child = taffy.new_leaf(taffy::style::Style { flex_grow: 1.0, ..Default::default() }).unwrap(); + let mut taffy = Taffy::new(); + let child = taffy.new_leaf(Style { flex_grow: 1.0, ..Default::default() }).unwrap(); let node = taffy .new_with_children( - taffy::style::Style { - size: taffy::geometry::Size { - width: taffy::style::Dimension::Points(100.0), - height: taffy::style::Dimension::Points(100.0), - }, + Style { + size: Size { width: Dimension::Points(100.0), height: Dimension::Points(100.0) }, ..Default::default() }, &[child], ) .unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(taffy.layout(child).unwrap().size.width, 100.0); assert_eq!(taffy.layout(child).unwrap().size.height, 100.0); @@ -495,15 +446,15 @@ mod measure { fn only_measure_once() { use std::sync::atomic; - let mut taffy = taffy::node::Taffy::new(); + let mut taffy = Taffy::new(); static NUM_MEASURES: atomic::AtomicU32 = atomic::AtomicU32::new(0); let grandchild = taffy .new_leaf_with_measure( - taffy::style::Style { ..Default::default() }, + Style { ..Default::default() }, MeasureFunc::Raw(|known_dimensions, _available_space| { NUM_MEASURES.fetch_add(1, atomic::Ordering::SeqCst); - taffy::geometry::Size { + Size { width: known_dimensions.width.unwrap_or(50.0), height: known_dimensions.height.unwrap_or(50.0), } @@ -511,10 +462,10 @@ mod measure { ) .unwrap(); - let child = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[grandchild]).unwrap(); + let child = taffy.new_with_children(Style { ..Default::default() }, &[grandchild]).unwrap(); - let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[child]).unwrap(); - taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap(); + let node = taffy.new_with_children(Style { ..Default::default() }, &[child]).unwrap(); + taffy.compute_layout(node, Size::MAX_CONTENT).unwrap(); assert_eq!(NUM_MEASURES.load(atomic::Ordering::SeqCst), 1); } diff --git a/tests/simple_child.rs b/tests/simple_child.rs index 0098f681a..8bee5d748 100644 --- a/tests/simple_child.rs +++ b/tests/simple_child.rs @@ -35,10 +35,7 @@ fn simple_child() { .unwrap(); let node1 = taffy .new_with_children( - taffy::style::Style { - size: taffy::geometry::Size { width: Dimension::Undefined, height: Dimension::Undefined }, - ..Default::default() - }, + taffy::style::Style { size: taffy::geometry::Size::auto(), ..Default::default() }, &[node1_0, node1_1], ) .unwrap();