Avoid FlowContainer
crash with TextureRect
using EXPAND_FIT_*
expand modes
#94286
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.
When a
FlowContainer
had aTextureRect
child using any of the EXPAND_FIT_* expand modes, it could crash when changing theFlowContainer
's minimum size, or that of its children. This was due to theTextureRect
resizing inFlowContainer::_resort
, updating its minimum size, and triggering another_resort
. If theTextureRect
's minimum size changed in a way that caused any of theFlowContainer
's children to be put on a different line, it could repeatedly cause_resort
to be called again, moving the children back and forth between the old and new lines.This change is for
FlowContainer::_resort
to give a warning forTextureRect
s with EXPAND_FIT_* expand modes when multiple lines are used, and just keep theTextureRect
size the same in that case. This is similar to the check added toAspectRatioContainer
in #73396, but attempting to still support it inFlowContainer
when possible. In the case where theTextureRect
is forced to stay the same size, there may be some overlap between theFlowContainer
's children, but should no longer crash.Fixes #93767