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.
cross_intrinsic_size
bookkeeping in Placer #5762This is an attempt at fixing #5138 by bookkeeping an
intrinsic_size
in the placer that is then used by theArea
to set the max_rect on the next frame.This should allow us to remove the
sizing_pass
, meaningArea
can dynamically adjust to the content size while supporting justified and centered layouts.This is very much WIP and there are still lots of open questions.
From my expermimentation it seems the biggest risk here is correctly implementing the intrinsic size calculation for every widget and container, which today can't be done automatically since every widget does it's own thing here (e.g. Button has right_text and image, which need to be handled correctly). This took me on a detour finding a abstraction on intra widget layout, resulting in #5830, which is very exiting in general and should also make building custom widgets a lot easier.
This layout thing could then also implement the intrinsic size calculation, meaning we only need to calculate it separately for containers.
Having the instrinsic size should also allow future improvements in other areas, e.g. making
ui.horizontal
smarter by looking at last frames intrinsic size and improving egui_flex support foradd_ui