Pass cross-axis known_dimension when computing flex item min size #545
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 bevyengine/bevy#9841
Pass cross-axis known_dimension when computing flex item min size
(fixes sizing of children that have inherent aspect ratio (e.g. images))
Context
I would like to add a gentest for this case. However, it requires extending the gentest harness to handle images, and I would like to avoid conflicts with #490 which also modifies that harness (and I suspect would be a pain to rebase on top of other changes). So I propose to create an issue (#546) for the test, merge just the fix, and then add the test once #490 lands.
I also intend to backport this to 0.3.x seeing as it's so small and it has been reported by a Bevy user. So I've stuck the changelog entry under 0.3.14.
Feedback wanted
Does this seem like a reasonable approach?
P.S. The only really meaningful change in this diff is the very bottom line. The rest is just moving code higher up the function to avoid recomputing a value. And removing a redundant
.clamp()
that was being called on an already-clamped value.