Fix weird behavior in image view with certain filters

This commit is contained in:
Jetz
2025-05-11 00:59:10 -04:00
committed by Chris H
parent 0b5f14cd9c
commit ca59ac925c
2 changed files with 3 additions and 1 deletions

View File

@@ -1003,6 +1003,8 @@ public abstract class ItemManager<T extends InventoryItem> extends FContainer im
private class ContextMenu extends FDropDownMenu { private class ContextMenu extends FDropDownMenu {
@Override @Override
protected void buildMenu() { protected void buildMenu() {
if (getSelectedItem() == null)
return;
contextMenuBuilder.buildMenu(this, getSelectedItem()); contextMenuBuilder.buildMenu(this, getSelectedItem());
} }

View File

@@ -601,7 +601,7 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
for (int i = groups.get().size() - 1; i >= 0; i--) { for (int i = groups.get().size() - 1; i >= 0; i--) {
Group group = groups.get().get(i); Group group = groups.get().get(i);
if (!group.isCollapsed) { if (!group.isCollapsed && !group.items.isEmpty()) {
for (int j = group.piles.size() - 1; j >= 0; j--) { for (int j = group.piles.size() - 1; j >= 0; j--) {
float relX = x + group.getScrollLeft() - group.getLeft(); float relX = x + group.getScrollLeft() - group.getLeft();
float relY = y + getScrollValue(); float relY = y + getScrollValue();