mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Prevent showing groups with no cards in them
This commit is contained in:
@@ -572,17 +572,19 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
||||
}
|
||||
|
||||
groupY = y;
|
||||
|
||||
if (group.items.isEmpty()) {
|
||||
group.setBounds(groupX, groupY, groupWidth, 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (groupBy != null) {
|
||||
y += GROUP_HEADER_HEIGHT + PADDING; //leave room for group header
|
||||
if (group.isCollapsed || group.items.isEmpty()) {
|
||||
if (group.isCollapsed) {
|
||||
group.setBounds(groupX, groupY, groupWidth, GROUP_HEADER_HEIGHT);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (group.items.isEmpty()) {
|
||||
group.setBounds(groupX, groupY, groupWidth, 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pileBy == null) {
|
||||
//if not piling by anything, wrap items using a pile for each row
|
||||
|
||||
@@ -450,19 +450,21 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
||||
}
|
||||
|
||||
groupY = y;
|
||||
|
||||
if (group.items.isEmpty()) {
|
||||
group.setBounds(groupX, groupY, groupWidth, 0);
|
||||
group.scrollWidth = groupWidth;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (groupBy != null) {
|
||||
y += GROUP_HEADER_HEIGHT + PADDING; //leave room for group header
|
||||
if (group.isCollapsed || group.items.isEmpty()) {
|
||||
if (group.isCollapsed) {
|
||||
group.setBounds(groupX, groupY, groupWidth, GROUP_HEADER_HEIGHT);
|
||||
group.scrollWidth = groupWidth;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (group.items.isEmpty()) {
|
||||
group.setBounds(groupX, groupY, groupWidth, 0);
|
||||
group.scrollWidth = groupWidth;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pileBy == null) {
|
||||
//if not piling by anything, wrap items using a pile for each row
|
||||
|
||||
Reference in New Issue
Block a user