Skip to content
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

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

coumcashier
Copy link
Contributor

@coumcashier coumcashier commented Oct 2, 2023

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
image

before
image

The 3rd last item has incorrect height because it is using the first rows height. the last 3 items correct height was lost.

@coumcashier coumcashier requested a review from a team as a code owner October 2, 2023 05:04
@coumcashier coumcashier changed the title itemlist bug fix: last n items' height is incorrectly overwritten Itemlist: last n items' height is incorrectly overwritten Oct 2, 2023
@coumcashier coumcashier changed the title Itemlist: last n items' height is incorrectly overwritten Itemlist Grid Mode: Last n items' height is incorrectly overwritten Oct 2, 2023
@Calinou Calinou added this to the 4.2 milestone Oct 2, 2023
@Calinou Calinou added the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Oct 2, 2023
@coumcashier coumcashier changed the title Itemlist Grid Mode: Last n items' height is incorrectly overwritten ItemList Grid Mode: Last n items' height is incorrectly overwritten Oct 2, 2023
@YuriSizov YuriSizov changed the title ItemList Grid Mode: Last n items' height is incorrectly overwritten Fix storing invalid item height values in ItemList Nov 10, 2023
@YuriSizov YuriSizov added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Nov 10, 2023
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.
Copy link
Contributor

@YuriSizov YuriSizov left a 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.

@Chubercik
Copy link
Contributor

Should someone open a PR with the 3.x patch, or is something like that done automatically once assigned the cherrypick:3.x label?

@YuriSizov
Copy link
Contributor

Should someone open a PR with the 3.x patch, or is something like that done automatically once assigned the cherrypick:3.x label?

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.

@akien-mga akien-mga merged commit 7f8edaa into godotengine:master Nov 10, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Jan 23, 2024
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:3.x Considered for cherry-picking into a future 3.x release topic:gui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The hover area of files in FileSystem is sometimes smaller than the text
5 participants