Skip to content

Conversation

@rossleonardy
Copy link
Contributor

Objective

Solution

I had to make some rather un-ergonomic changes I would like advice on, so I've left comments below.

Testing

  • Pending...

Showcase

Screenshot 2025-10-27 at 8 18 50 PM

Fixes issue with grid start and ends...

@rossleonardy rossleonardy changed the title Update taffy to 9.0 and fix Grid errors #21240 Update taffy to 0.9 and fix Grid errors #21240 Oct 28, 2025

# other
taffy = { version = "0.7" }
taffy = { version = "0.9", default-features = false, features = ["std", "block_layout", "flexbox", "grid", "content_size", "alloc", "taffy_tree"] }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calc feature puts !Send+!Sync stuff everywhere, so it breaks derive(Resource) among other things. Manually excluding it here.

.collect::<Vec<_>>(),
grid_row: node.grid_row.into(),
grid_column: node.grid_column.into(),
..Default::default()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fields added are dummy, item_is_replaced, grid_template_areas, grid_template_column_names, grid_template_row_names. Not sure if this should be using their default or we should add these fields and have our own default.

Val::Px(val)
.into_length_percentage(context)
.into_raw()
.value(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These rather verbose conversions are due to the fact that we do some math in into_length_percentage and into_length_percentage_auto, I would like to refactor the Val type story but this keeps the behavior the same

) -> taffy::style::GridTemplateComponent<S>
where
S: CheapCloneStr,
{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an add things until it compiles moment, if anyone can explain what the generics mean here I would appreciate it

@github-actions
Copy link
Contributor

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke!
You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-21672

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

}
}

pub(crate) struct BevyTaffyTree<T>(TaffyTree<T>);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sort of a patch for an issue with Taffy:
ccbrown/iocraft#119 (comment)
Eventually it will be fixed in
DioxusLabs/taffy#823

@JMS55 JMS55 requested a review from ickshonpe October 28, 2025 01:15
@github-actions
Copy link
Contributor

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke!
You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-21672

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

@github-actions
Copy link
Contributor

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke!
You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-21672

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

@github-actions
Copy link
Contributor

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke!
You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-21672

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

@github-actions
Copy link
Contributor

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke!
You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-21672

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant