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

Trampoline child measurement/layout through the LayoutTree trait #427

Conversation

nicoburns
Copy link
Collaborator

Objective

The objective here it to make is easy to embed Taffy as part of a larger layout implementation rather than usage of Taffy requiring you to "buy in" to having all your layouting needs handled by Taffy.

This is the core change from #326
Fixes #28

Context

See #28 (comment)

Notes

Seems to be relatively perf-neutral.

@nicoburns nicoburns added enhancement New feature or request usability Make the library more comfortable to use breaking-change A change that breaks our public interface labels Apr 10, 2023
@nicoburns nicoburns mentioned this pull request Apr 10, 2023
13 tasks
@nicoburns nicoburns force-pushed the add-child-layout-function-to-layout-tree-trait branch from 4adf897 to e427cf7 Compare April 10, 2023 16:49
Copy link
Collaborator

@TimJentzsch TimJentzsch left a comment

Choose a reason for hiding this comment

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

Seems solid to me.

I think it would be great to add a simple example demonstrating how to use these new capabilities, if possible.
This would make it easier to detect limitations of the approach and also serve as a useful reference to library authors to integrate this.

src/node.rs Outdated Show resolved Hide resolved
@Weibye
Copy link
Collaborator

Weibye commented Apr 10, 2023

Seems solid to me.

I think it would be great to add a simple example demonstrating how to use these new capabilities, if possible. This would make it easier to detect limitations of the approach and also serve as a useful reference to library authors to integrate this.

Yes, it's strange that this doesn't affect any of our examples, which means our examples are lacking.

@nicoburns
Copy link
Collaborator Author

Seems solid to me.
I think it would be great to add a simple example demonstrating how to use these new capabilities, if possible. This would make it easier to detect limitations of the approach and also serve as a useful reference to library authors to integrate this.

Yes, it's strange that this doesn't affect any of our examples, which means our examples are lacking.

This API was never really properly designed/launched. It was introduced as part of a PR which was necesary for refactoring Flexbox to interop with CSS Grid. One of my main aims for Taffy 0.4 is to sort this out and make this API useful.

@nicoburns nicoburns merged commit 325413c into DioxusLabs:main Apr 10, 2023
13 checks passed
@nicoburns nicoburns deleted the add-child-layout-function-to-layout-tree-trait branch April 10, 2023 17:27
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 enhancement New feature or request usability Make the library more comfortable to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support multiple layout algorithms
3 participants