-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix storing invalid item height values in ItemList
#82660
Conversation
ItemList
The height of the last N items is incorrectly overwritten with the max height of first row (N = number of columns). This happen in the first iteration of the while loop. Moving this code inside if (all_fit) makes sure the last rows height is only updated at the end when max height (max_h) is calculated for the last row.
4d9b01a
to
1533292
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work correctly and the explanation makes sense.
The code hasn't changed since #4847, so I would assume this fix would be relevant to 3.x as well.
I rebased and reworded your commit on your behalf. Please be mindful of your commit messages in the future, we prefer them to follow a similar style.
Should someone open a PR with the |
I think it should be cherry-pickable, i.e. it will be done by maintainers. If not, they will remove the label and leave a comment about it. |
Thanks! |
Cherry-picked for 4.1.4. |
fixes #80793
Last n items' height is incorrectly overwritten with the max height of first row (n = number of columns). This happens in the first iteration of the while loop. Moving this code inside if (all_fit) makes sure the last rows height is only updated at the last iteration of the while loop when max height (max_h) is calculated for the last row.
after
before
The 3rd last item has incorrect height because it is using the first rows height. the last 3 items correct height was lost.