You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm definitely open to a feature like this, however:
Why have you introduced so many Boxs? I think it should be possible to implement this without boxing.
I think we'll want Display::Custom to work like measure functions and be a single function passed to a compute_layout_* method, for the same reason that measure functions work like this: it allows them to borrow external context. I think the main difference between this and measure functions is that custom layout would need to be able to size and position children.
We should think about whether we need both measure functions and custom layouts or whether this should replace measure functions.
Not sure what I think about the "name" parameter. It seems fine, but it may be better to replace it with an ID or just rely on the node context.
Why have you introduced so many Boxs? I think it should be possible to implement this without boxing.
yeah thing is this is the only way to make that trait a trait object and I didn't want to make Display generic over Tree: LayoutPartialTree cause that way Style would also need to be generic over that etc...
Why have you introduced so many Boxs? I think it should be possible to implement this without boxing.
yeah thing is this is the only way to make that trait a trait object and I didn't want to make Display generic over Tree: LayoutPartialTree cause that way Style would also need to be generic over that etc...
Ah, I see. I think this can be solved by making the custom layout function something that is passed in to the call to layout() similar to layout_with_measure. This means that the type only needs to exist in the function signature (and the TaffyView struct) and can be implemented as a generic (and as a bonus allows that function to (mutably) borrow external data if it wants to). Measure functions used to be stored within the Taffy struct similarly to your implementation here but this was changed for these same reasons.
@nicoburns are there any news on this? I'd happily modify this to conform to the API you describe, but question is would it go upstream :D
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
controversialThis work requires a heightened standard of review due to implementation or design complexityenhancementNew feature or request
3 participants
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.
DRAFT
Objective
There's been some talk about providing a way to define your own layouts, this would enable this