Fix storing invalid item height values in `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.

(cherry picked from commit 1533292f09)
This commit is contained in:
coumcashier 2023-11-10 19:50:58 +01:00 committed by Yuri Sizov
parent 1e460e37c3
commit 4619d34b91
1 changed files with 4 additions and 4 deletions

View File

@ -1443,11 +1443,11 @@ void ItemList::_check_shape_changed() {
}
}
for (int j = items.size() - 1; j >= 0 && col > 0; j--, col--) {
items.write[j].rect_cache.size.y = max_h;
}
if (all_fit) {
for (int j = items.size() - 1; j >= 0 && col > 0; j--, col--) {
items.write[j].rect_cache.size.y = max_h;
}
float page = MAX(0, size.height - theme_cache.panel_style->get_minimum_size().height);
float max = MAX(page, ofs.y + max_h);
if (auto_height) {