Invalidate GridContainer
only on DrawSize change
#6180
Merged
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.
Recomputing
GridContainer
's layout is pretty allocation-heavy, which is happening duringDrawInfo
invalidation (common case - position change such as scrolling through overlays, comments, etc.).Changing invalidation from
DrawSize
toInvalidation.DrawInfo | Invalidation.RequiredParentSizeToFit
was a deliberate choice in b0f4473 since looks like at the time of it's implementation nested grids weren't working properly.However currently it seems like everything works fine somehow: tests are passing and as far as I can tell everything is good osu-side.
Also FlowContainer has similar logic and it relies only on DrawSize invalidations which has been more than enough for years.
So I dunno. More eyes can find any problems if there are any, so I figured it's better to open a pr than just sitting on it guessing.
Example of scrolling in beatmap listing: