Refactor compute_layout_with_measure to return LayoutOutput directly#953
Open
josephg wants to merge 1 commit into
Open
Refactor compute_layout_with_measure to return LayoutOutput directly#953josephg wants to merge 1 commit into
josephg wants to merge 1 commit into
Conversation
… and not call compute_leaf_layout implicitly Fixes DioxusLabs#199
Member
|
@ickshonpe Does this change make sense to you? It would allow Bevy to integrate baseline alignment into Taffy. And if you want compatibility with the old simpler API then that would involve wrapping your old-style measure function in an explicit call to |
Contributor
|
It's definitely definitely something I'd like us to support better in Bevy. I'll make a quick test branch with bevy_ui using this in a little example, shouldn't be complicated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Fixes #199. This PR aims to make it easier for people using TaffyTree to set the Baseline on layout nodes. Currently its only possible to do this using the lower level API (by making your own tree).
This is a breaking API change, since the signature is part of the public API.
I've also written new tests in tests/hand_written/baseline.rs.
Feedback wanted
This change takes out the implicit call to
compute_leaf_layoutincompute_child_layout. I've added that call back in a bunch of places - eg in TaffyTree:I'm not super familiar with the codebase; let me know if this is a mistake.