From c83608da41161141b31ab5bf6961352e7870c505 Mon Sep 17 00:00:00 2001
From: Nico Burns
Date: Tue, 23 Aug 2022 16:40:29 +0100
Subject: [PATCH] Add support for align-items: space-evenly (#218)
* Add support for align-items: space-evenly
* Add AlignContent::SpaceEvenly to RELEASES.md
* Fix typo in AlignContent doc comments (gap -> gaps)
Co-authored-by: Andreas Weibye <13300393+Weibye@users.noreply.github.com>
* Fix align_content_space_around_single_line test
Co-authored-by: Andreas Weibye <13300393+Weibye@users.noreply.github.com>
---
RELEASES.md | 1 +
.../generated/align_content_space_around.rs | 97 ++++++++++++++
.../align_content_space_around_single_line.rs | 96 +++++++++++++
.../align_content_space_around_wrapped.rs | 97 ++++++++++++++
.../generated/align_content_space_between.rs | 97 ++++++++++++++
...align_content_space_between_single_line.rs | 96 +++++++++++++
.../align_content_space_between_wrapped.rs | 97 ++++++++++++++
.../generated/align_content_space_evenly.rs | 97 ++++++++++++++
.../align_content_space_evenly_single_line.rs | 96 +++++++++++++
.../align_content_space_evenly_wrapped.rs | 97 ++++++++++++++
benches/generated/mod.rs | 12 ++
scripts/gentest/src/main.rs | 1 +
src/flexbox.rs | 1 +
src/style.rs | 31 +++--
...lign_content_space_around_single_line.html | 22 +++
.../align_content_space_around_wrapped.html | 22 +++
...ign_content_space_between_single_line.html | 22 +++
.../align_content_space_between_wrapped.html | 22 +++
...lign_content_space_evenly_single_line.html | 22 +++
.../align_content_space_evenly_wrapped.html | 22 +++
tests/generated/align_content_space_around.rs | 126 ++++++++++++++++++
.../align_content_space_around_single_line.rs | 125 +++++++++++++++++
.../align_content_space_around_wrapped.rs | 126 ++++++++++++++++++
.../generated/align_content_space_between.rs | 126 ++++++++++++++++++
...align_content_space_between_single_line.rs | 125 +++++++++++++++++
.../align_content_space_between_wrapped.rs | 126 ++++++++++++++++++
tests/generated/align_content_space_evenly.rs | 126 ++++++++++++++++++
.../align_content_space_evenly_single_line.rs | 125 +++++++++++++++++
.../align_content_space_evenly_wrapped.rs | 126 ++++++++++++++++++
tests/generated/mod.rs | 6 +
30 files changed, 2172 insertions(+), 13 deletions(-)
create mode 100644 benches/generated/align_content_space_around.rs
create mode 100644 benches/generated/align_content_space_around_single_line.rs
create mode 100644 benches/generated/align_content_space_around_wrapped.rs
create mode 100644 benches/generated/align_content_space_between.rs
create mode 100644 benches/generated/align_content_space_between_single_line.rs
create mode 100644 benches/generated/align_content_space_between_wrapped.rs
create mode 100644 benches/generated/align_content_space_evenly.rs
create mode 100644 benches/generated/align_content_space_evenly_single_line.rs
create mode 100644 benches/generated/align_content_space_evenly_wrapped.rs
create mode 100644 test_fixtures/align_content_space_around_single_line.html
create mode 100644 test_fixtures/align_content_space_around_wrapped.html
create mode 100644 test_fixtures/align_content_space_between_single_line.html
create mode 100644 test_fixtures/align_content_space_between_wrapped.html
create mode 100644 test_fixtures/align_content_space_evenly_single_line.html
create mode 100644 test_fixtures/align_content_space_evenly_wrapped.html
create mode 100644 tests/generated/align_content_space_around.rs
create mode 100644 tests/generated/align_content_space_around_single_line.rs
create mode 100644 tests/generated/align_content_space_around_wrapped.rs
create mode 100644 tests/generated/align_content_space_between.rs
create mode 100644 tests/generated/align_content_space_between_single_line.rs
create mode 100644 tests/generated/align_content_space_between_wrapped.rs
create mode 100644 tests/generated/align_content_space_evenly.rs
create mode 100644 tests/generated/align_content_space_evenly_single_line.rs
create mode 100644 tests/generated/align_content_space_evenly_wrapped.rs
diff --git a/RELEASES.md b/RELEASES.md
index 582b691fa..3d8d8381e 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -9,6 +9,7 @@
- Builder methods are now `const` where possible
- Several convenience constants have been defined: notably `FlexboxLayout::DEFAULT`
- New `Layout` convenience constructor: `with_order(order: u32)`
+- Added support for `AlignContent::SpaceEvenly`
### 0.2.0 Changed
diff --git a/benches/generated/align_content_space_around.rs b/benches/generated/align_content_space_around.rs
new file mode 100644
index 000000000..667024a5a
--- /dev/null
+++ b/benches/generated/align_content_space_around.rs
@@ -0,0 +1,97 @@
+pub fn compute() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: taffy::style::AlignContent::SpaceAround,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+}
diff --git a/benches/generated/align_content_space_around_single_line.rs b/benches/generated/align_content_space_around_single_line.rs
new file mode 100644
index 000000000..b9c494427
--- /dev/null
+++ b/benches/generated/align_content_space_around_single_line.rs
@@ -0,0 +1,96 @@
+pub fn compute() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ align_content: taffy::style::AlignContent::SpaceAround,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+}
diff --git a/benches/generated/align_content_space_around_wrapped.rs b/benches/generated/align_content_space_around_wrapped.rs
new file mode 100644
index 000000000..667024a5a
--- /dev/null
+++ b/benches/generated/align_content_space_around_wrapped.rs
@@ -0,0 +1,97 @@
+pub fn compute() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: taffy::style::AlignContent::SpaceAround,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+}
diff --git a/benches/generated/align_content_space_between.rs b/benches/generated/align_content_space_between.rs
new file mode 100644
index 000000000..27df4fe08
--- /dev/null
+++ b/benches/generated/align_content_space_between.rs
@@ -0,0 +1,97 @@
+pub fn compute() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: taffy::style::AlignContent::SpaceBetween,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+}
diff --git a/benches/generated/align_content_space_between_single_line.rs b/benches/generated/align_content_space_between_single_line.rs
new file mode 100644
index 000000000..bd7696d87
--- /dev/null
+++ b/benches/generated/align_content_space_between_single_line.rs
@@ -0,0 +1,96 @@
+pub fn compute() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ align_content: taffy::style::AlignContent::SpaceBetween,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+}
diff --git a/benches/generated/align_content_space_between_wrapped.rs b/benches/generated/align_content_space_between_wrapped.rs
new file mode 100644
index 000000000..27df4fe08
--- /dev/null
+++ b/benches/generated/align_content_space_between_wrapped.rs
@@ -0,0 +1,97 @@
+pub fn compute() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: taffy::style::AlignContent::SpaceBetween,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+}
diff --git a/benches/generated/align_content_space_evenly.rs b/benches/generated/align_content_space_evenly.rs
new file mode 100644
index 000000000..812842224
--- /dev/null
+++ b/benches/generated/align_content_space_evenly.rs
@@ -0,0 +1,97 @@
+pub fn compute() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: taffy::style::AlignContent::SpaceEvenly,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+}
diff --git a/benches/generated/align_content_space_evenly_single_line.rs b/benches/generated/align_content_space_evenly_single_line.rs
new file mode 100644
index 000000000..ce9ad599b
--- /dev/null
+++ b/benches/generated/align_content_space_evenly_single_line.rs
@@ -0,0 +1,96 @@
+pub fn compute() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ align_content: taffy::style::AlignContent::SpaceEvenly,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+}
diff --git a/benches/generated/align_content_space_evenly_wrapped.rs b/benches/generated/align_content_space_evenly_wrapped.rs
new file mode 100644
index 000000000..812842224
--- /dev/null
+++ b/benches/generated/align_content_space_evenly_wrapped.rs
@@ -0,0 +1,97 @@
+pub fn compute() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: taffy::style::AlignContent::SpaceEvenly,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+}
diff --git a/benches/generated/mod.rs b/benches/generated/mod.rs
index 62062ffc5..d9de95bdd 100644
--- a/benches/generated/mod.rs
+++ b/benches/generated/mod.rs
@@ -24,6 +24,12 @@ mod align_baseline;
mod align_baseline_child_multiline;
mod align_baseline_nested_child;
mod align_center_should_size_based_on_content;
+mod align_content_space_around_single_line;
+mod align_content_space_around_wrapped;
+mod align_content_space_between_single_line;
+mod align_content_space_between_wrapped;
+mod align_content_space_evenly_single_line;
+mod align_content_space_evenly_wrapped;
mod align_flex_start_with_shrinking_children;
mod align_flex_start_with_shrinking_children_with_stretch;
mod align_flex_start_with_stretching_children;
@@ -265,6 +271,12 @@ fn benchmark(c: &mut Criterion) {
align_baseline_child_multiline::compute();
align_baseline_nested_child::compute();
align_center_should_size_based_on_content::compute();
+ align_content_space_around_single_line::compute();
+ align_content_space_around_wrapped::compute();
+ align_content_space_between_single_line::compute();
+ align_content_space_between_wrapped::compute();
+ align_content_space_evenly_single_line::compute();
+ align_content_space_evenly_wrapped::compute();
align_flex_start_with_shrinking_children::compute();
align_flex_start_with_shrinking_children_with_stretch::compute();
align_flex_start_with_stretching_children::compute();
diff --git a/scripts/gentest/src/main.rs b/scripts/gentest/src/main.rs
index 4694b5652..7634b8146 100644
--- a/scripts/gentest/src/main.rs
+++ b/scripts/gentest/src/main.rs
@@ -293,6 +293,7 @@ fn generate_node(ident: &str, node: &json::JsonValue) -> TokenStream {
"center" => quote!(align_content: taffy::style::AlignContent::Center,),
"space-between" => quote!(align_content: taffy::style::AlignContent::SpaceBetween,),
"space-around" => quote!(align_content: taffy::style::AlignContent::SpaceAround,),
+ "space-evenly" => quote!(align_content: taffy::style::AlignContent::SpaceEvenly,),
_ => quote!(),
},
_ => quote!(),
diff --git a/src/flexbox.rs b/src/flexbox.rs
index e06c9bf88..2cc894871 100644
--- a/src/flexbox.rs
+++ b/src/flexbox.rs
@@ -1311,6 +1311,7 @@ impl Taffy {
}
}
AlignContent::Stretch => 0.0,
+ AlignContent::SpaceEvenly => free_space / (num_lines + 1) as f32,
AlignContent::SpaceBetween => {
if is_first {
0.0
diff --git a/src/style.rs b/src/style.rs
index 53cf78122..d1f11dd86 100644
--- a/src/style.rs
+++ b/src/style.rs
@@ -66,18 +66,22 @@ impl Default for AlignSelf {
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum AlignContent {
- /// Items are packed toward the start of the cross axis
+ /// Items are packed toward the start of the axis
FlexStart,
- /// Items are packed toward the end of the cross axis
+ /// Items are packed toward the end of the axis
FlexEnd,
- /// Items are packed along the center of the cross axis
+ /// Items are centered around the middle of the axis
Center,
- /// Distribute items evenly, but stretch them to fill the container
+ /// Items are stretched to fill the container
Stretch,
- /// Distribute items evenly, such that the first and last item are aligned with the edges
+ /// The first and last items are aligned flush with the edges of the container (no gap)
+ /// The gap between items is distributed evenly.
SpaceBetween,
- /// Distribute items evenly,
- /// such that the space between items is the same as the space between the first and last item and the edges
+ /// The gap between the first and last items is exactly THE SAME as the gap between items.
+ /// The gaps are distributed evenly
+ SpaceEvenly,
+ /// The gap between the first and last items is exactly HALF the gap between items.
+ /// The gaps are distributed evenly in proportion to these ratios.
SpaceAround,
}
@@ -177,14 +181,15 @@ pub enum JustifyContent {
FlexEnd,
/// Items are packed along the center of the main axis
Center,
- /// Distribute items evenly, such that the first and last item are aligned with the edges
+ /// The first and last items are aligned flush with the edges of the container (no gap)
+ /// The gaps between items are distributed evenly.
SpaceBetween,
- /// Distribute items evenly,
- /// such that the space between items is twice same as the space between the first and last item and the edges
- SpaceAround,
- /// Distribute items evenly,
- /// such that the space between items is the same as the space between the first and last item and the edges
+ /// The gap between the first and last items is exactly THE SAME as the gap between items.
+ /// The gaps are distributed evenly
SpaceEvenly,
+ /// The gap between the first and last items is exactly HALF the gap between items.
+ /// The gaps are distributed evenly in proportion to these ratios.
+ SpaceAround,
}
impl Default for JustifyContent {
diff --git a/test_fixtures/align_content_space_around_single_line.html b/test_fixtures/align_content_space_around_single_line.html
new file mode 100644
index 000000000..7aeb112c9
--- /dev/null
+++ b/test_fixtures/align_content_space_around_single_line.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+ Test description
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_around_wrapped.html b/test_fixtures/align_content_space_around_wrapped.html
new file mode 100644
index 000000000..906faee0a
--- /dev/null
+++ b/test_fixtures/align_content_space_around_wrapped.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+ Test description
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_between_single_line.html b/test_fixtures/align_content_space_between_single_line.html
new file mode 100644
index 000000000..0859b344c
--- /dev/null
+++ b/test_fixtures/align_content_space_between_single_line.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+ Test description
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_between_wrapped.html b/test_fixtures/align_content_space_between_wrapped.html
new file mode 100644
index 000000000..d83eed995
--- /dev/null
+++ b/test_fixtures/align_content_space_between_wrapped.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+ Test description
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_evenly_single_line.html b/test_fixtures/align_content_space_evenly_single_line.html
new file mode 100644
index 000000000..4bc9249d2
--- /dev/null
+++ b/test_fixtures/align_content_space_evenly_single_line.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+ Test description
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_evenly_wrapped.html b/test_fixtures/align_content_space_evenly_wrapped.html
new file mode 100644
index 000000000..59728e9cf
--- /dev/null
+++ b/test_fixtures/align_content_space_evenly_wrapped.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+ Test description
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/generated/align_content_space_around.rs b/tests/generated/align_content_space_around.rs
new file mode 100644
index 000000000..3ef9bf030
--- /dev/null
+++ b/tests/generated/align_content_space_around.rs
@@ -0,0 +1,126 @@
+#[test]
+fn align_content_space_around() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: taffy::style::AlignContent::SpaceAround,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+ 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);
+ assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.y, 12f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.y, 12f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.y, 45f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.y, 45f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.y, 78f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.y, 78f32);
+}
diff --git a/tests/generated/align_content_space_around_single_line.rs b/tests/generated/align_content_space_around_single_line.rs
new file mode 100644
index 000000000..b00612634
--- /dev/null
+++ b/tests/generated/align_content_space_around_single_line.rs
@@ -0,0 +1,125 @@
+#[test]
+fn align_content_space_around_single_line() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ align_content: taffy::style::AlignContent::SpaceAround,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+ 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);
+ assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.width, 17f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.width, 17f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.x, 17f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.width, 17f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.x, 33f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.width, 17f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.width, 17f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.x, 67f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.width, 17f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.x, 83f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.y, 0f32);
+}
diff --git a/tests/generated/align_content_space_around_wrapped.rs b/tests/generated/align_content_space_around_wrapped.rs
new file mode 100644
index 000000000..49829c6af
--- /dev/null
+++ b/tests/generated/align_content_space_around_wrapped.rs
@@ -0,0 +1,126 @@
+#[test]
+fn align_content_space_around_wrapped() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: taffy::style::AlignContent::SpaceAround,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+ 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);
+ assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.y, 12f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.y, 12f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.y, 45f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.y, 45f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.y, 78f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.y, 78f32);
+}
diff --git a/tests/generated/align_content_space_between.rs b/tests/generated/align_content_space_between.rs
new file mode 100644
index 000000000..7ee166d46
--- /dev/null
+++ b/tests/generated/align_content_space_between.rs
@@ -0,0 +1,126 @@
+#[test]
+fn align_content_space_between() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: taffy::style::AlignContent::SpaceBetween,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+ 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);
+ assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.y, 45f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.y, 45f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.y, 90f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.y, 90f32);
+}
diff --git a/tests/generated/align_content_space_between_single_line.rs b/tests/generated/align_content_space_between_single_line.rs
new file mode 100644
index 000000000..a64ad5d8e
--- /dev/null
+++ b/tests/generated/align_content_space_between_single_line.rs
@@ -0,0 +1,125 @@
+#[test]
+fn align_content_space_between_single_line() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ align_content: taffy::style::AlignContent::SpaceBetween,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+ 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);
+ assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.width, 10f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.width, 10f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.x, 10f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.width, 10f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.x, 20f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.width, 10f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.x, 30f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.width, 10f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.x, 40f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.width, 10f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.y, 0f32);
+}
diff --git a/tests/generated/align_content_space_between_wrapped.rs b/tests/generated/align_content_space_between_wrapped.rs
new file mode 100644
index 000000000..38caf0555
--- /dev/null
+++ b/tests/generated/align_content_space_between_wrapped.rs
@@ -0,0 +1,126 @@
+#[test]
+fn align_content_space_between_wrapped() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: taffy::style::AlignContent::SpaceBetween,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+ 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);
+ assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.y, 45f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.y, 45f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.y, 90f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.y, 90f32);
+}
diff --git a/tests/generated/align_content_space_evenly.rs b/tests/generated/align_content_space_evenly.rs
new file mode 100644
index 000000000..060d12f50
--- /dev/null
+++ b/tests/generated/align_content_space_evenly.rs
@@ -0,0 +1,126 @@
+#[test]
+fn align_content_space_evenly() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: taffy::style::AlignContent::SpaceEvenly,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+ 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);
+ assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.y, 18f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.y, 18f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.y, 45f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.y, 45f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.y, 73f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.y, 73f32);
+}
diff --git a/tests/generated/align_content_space_evenly_single_line.rs b/tests/generated/align_content_space_evenly_single_line.rs
new file mode 100644
index 000000000..848fbabf6
--- /dev/null
+++ b/tests/generated/align_content_space_evenly_single_line.rs
@@ -0,0 +1,125 @@
+#[test]
+fn align_content_space_evenly_single_line() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(10f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ align_content: taffy::style::AlignContent::SpaceEvenly,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+ 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);
+ assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.width, 10f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.width, 10f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.x, 10f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.width, 10f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.x, 20f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.width, 10f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.x, 30f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.width, 10f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.x, 40f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.width, 10f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.y, 0f32);
+}
diff --git a/tests/generated/align_content_space_evenly_wrapped.rs b/tests/generated/align_content_space_evenly_wrapped.rs
new file mode 100644
index 000000000..97b1d2467
--- /dev/null
+++ b/tests/generated/align_content_space_evenly_wrapped.rs
@@ -0,0 +1,126 @@
+#[test]
+fn align_content_space_evenly_wrapped() {
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node1 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node2 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node3 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node4 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node5 = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::FlexboxLayout {
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: taffy::style::AlignContent::SpaceEvenly,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ ..Default::default()
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::NONE).unwrap();
+ 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);
+ assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node0).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node0).unwrap().location.y, 18f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node1).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node1).unwrap().location.y, 18f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node2).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node2).unwrap().location.y, 45f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node3).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node3).unwrap().location.y, 45f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node4).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.x, 0f32);
+ assert_eq!(taffy.layout(node4).unwrap().location.y, 73f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.width, 50f32);
+ assert_eq!(taffy.layout(node5).unwrap().size.height, 10f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.x, 50f32);
+ assert_eq!(taffy.layout(node5).unwrap().location.y, 73f32);
+}
diff --git a/tests/generated/mod.rs b/tests/generated/mod.rs
index 561cf4ae2..1921c8704 100644
--- a/tests/generated/mod.rs
+++ b/tests/generated/mod.rs
@@ -23,6 +23,12 @@ mod align_baseline;
mod align_baseline_child_multiline;
mod align_baseline_nested_child;
mod align_center_should_size_based_on_content;
+mod align_content_space_around_single_line;
+mod align_content_space_around_wrapped;
+mod align_content_space_between_single_line;
+mod align_content_space_between_wrapped;
+mod align_content_space_evenly_single_line;
+mod align_content_space_evenly_wrapped;
mod align_flex_start_with_shrinking_children;
mod align_flex_start_with_shrinking_children_with_stretch;
mod align_flex_start_with_stretching_children;