Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass axis information when measuring a child's size #575

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

nicoburns
Copy link
Collaborator

@nicoburns nicoburns commented Nov 1, 2023

Objective

This enables Taffy to be integrated with Xilem.

See: linebender/xilem#140

Changes made

  • Add RequestedAxis enum
  • Add axis: RequestedAxis parameter to child measurement and plumb through to various places

Feedback wanted

  • API design review
  • Should we split apart the compute_child_layout methods on the PartialLayoutTree trait? Because the axis parameter is only really relevant to the "measure child" case rather than "perform layout" case. Also, the "measure child" case could return f32 instead of LayoutOutput in that case. Which would also reduce cache size.

@nicoburns nicoburns added usability Make the library more comfortable to use breaking-change A change that breaks our public interface labels Nov 1, 2023
@nicoburns nicoburns added this to the 0.4 milestone Nov 1, 2023
@nicoburns
Copy link
Collaborator Author

Seeing as this is approved, I think I'm just going to merge this now (and we can get Xilem running off Taffy main), and follow up with further changes in separate PRs, which will likely include:

  • Splitting the compute_child_layout method into 3 separate methods (eliminating the RunMode parameter).
  • Replacing the get_layout_mut method with a set_layout method (which allows integrators of Taffy to more easily route layout data to a storage location of their choice)

@nicoburns nicoburns merged commit 6d7f3cf into DioxusLabs:main Nov 2, 2023
17 checks passed
@nicoburns nicoburns deleted the xilem-integration branch November 2, 2023 13:19
@nicoburns nicoburns restored the xilem-integration branch November 2, 2023 13:19
@alice-i-cecile
Copy link
Collaborator

Yep, agreed with that. I didn't have strong opinions about the architecture here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change A change that breaks our public interface usability Make the library more comfortable to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants