Merge pull request #114709 from YeldhamDev/itemlist_icon_top_fix

Fix incorrect position of icons in `ItemList` when on top mode
This commit is contained in:
Rémi Verschelde 2026-01-08 15:17:26 +01:00
commit 877188dab1
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -1550,11 +1550,10 @@ void ItemList::_notification(int p_what) {
if (icon_mode == ICON_MODE_TOP) {
pos.x += Math::floor((items[i].rect_cache.size.width - icon_size.width) / 2);
pos.y += theme_cache.icon_margin;
text_ofs.y = icon_size.height + theme_cache.icon_margin * 2;
} else {
pos.y += Math::floor((items[i].rect_cache.size.height - icon_size.height) / 2);
text_ofs.x = icon_size.width + theme_cache.icon_margin;
text_ofs.x = icon_size.width + theme_cache.icon_margin * 2;
}
Rect2 draw_rect = Rect2(pos, icon_size);