FlexboxLayout: fix too-short auto-sized window with a nested flexbox - #12811
Open
dfaure-kdab wants to merge 2 commits into
Open
FlexboxLayout: fix too-short auto-sized window with a nested flexbox#12811dfaure-kdab wants to merge 2 commits into
dfaure-kdab wants to merge 2 commits into
Conversation
No behavior change: move ChildElem, the child-element collection, and the measure body out of solve_flexbox_layout into module-level functions, so an upcoming change can reuse them for the layout-info path.
The window height comes from the root's vertical layout info at the preferred width. That cross-axis info path ran taffy without a measure callback, so a nested wrapping flexbox cell kept the height pre-measured at the container width instead of the width taffy assigns it (its own preferred width, where it wraps to more lines). - add flexbox_layout_info_cross_axis_with_measure and pass the same measure callback the solve path uses (interpreter only for now) - a (None, None) measure must return a self-consistent pair (the height at the returned width): taffy passes the assigned width in a later query, but serves it from its measure cache when the width matches the earlier probe's result, reusing the probe's stale height - only re-measure height-for-width builtins through the Item vtable; for others it returns trivial info and would drop element-level constraints like preferred-height The generated-code info path has no measure callback yet, so the new test is ignored for rust and cpp.
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.
FlexboxLayout: fix too-short auto-sized window with a nested flexbox
The window height comes from the root's vertical layout info at the
preferred width. That cross-axis info path ran taffy without a measure
callback, so a nested wrapping flexbox cell kept the height pre-measured
at the container width instead of the width taffy assigns it (its own
preferred width, where it wraps to more lines).
measure callback the solve path uses (interpreter only for now)
at the returned width): taffy passes the assigned width in a later
query, but serves it from its measure cache when the width matches the
earlier probe's result, reusing the probe's stale height
for others it returns trivial info and would drop element-level
constraints like preferred-height
The generated-code info path has no measure callback yet, so the new test is ignored for rust and cpp
(will be fixed in a followup PR).
Easier to review the two commits separately, the first one is a no-op refactoring for code reuse.