The Bug:
Bundles with more than two rows of items don't fill up empty spaces with new items.
Steps to Reproduce:
Fill a bundle with 16 items.
Take out 2 items and observe the bundle tooltip and observe how there are two empty spaces despite the tooltip saying +X.
Observed Behavior:
Bundles with more than two rows of items don't fill up empty spaces with new items.
Expected Behavior:
Bundles with more than two rows of items would fill up empty spaces with new items.
Linked issues
is duplicated by 2
Attachments
Comments 4
Still present in 26.1.2 - root cause analysis is bug in math in a in a
current code:
public int getNumberOfItemsToShow() {
int numberOfItemStacks = this.size();
int availableItemsToShow = numberOfItemStacks > 12 ? 11 : 12;
int itemsOnNonFullRow = numberOfItemStacks % 4;
int emptySpaceOnNonFullRow = itemsOnNonFullRow == 0 ? 0 : 4 - itemsOnNonFullRow;
return Math.min(numberOfItemStacks, availableItemsToShow - emptySpaceOnNonFullRow);
}correct code:
public int getNumberOfItemsToShow() {
int numberOfItemStacks = this.size();
int availableItemsToShow = numberOfItemStacks > 12 ? 11 : 12;
int itemsOnNonFullRow = availableItemsToShow % 4; // <-- here it should take how many items should be in last row
int emptySpaceOnNonFullRow = itemsOnNonFullRow == 0 ? 0 : 4 - itemsOnNonFullRow;
return Math.min(numberOfItemStacks, availableItemsToShow - emptySpaceOnNonFullRow);
}the whole logic could be simplified though to:
public int getNumberOfItemsToShow() {
return Math.min(this.size(), 11);
}
Can confirm: