Fix DraggedStack in Bookmarks (#527)

Co-authored-by: slprime <history-21@yandex.ru>
This commit is contained in:
slprimeandslprime authored and GitHub committed 2024-09-12 18:14:00 +02:00
1 parent 9563ebfe5a
commit b328fd3db1
2 files changed
+8 -2

No files matched your search

@@ -2109,6 +2109,9 @@ public class BookmarkPanel extends PanelWidget {
@Override
public void mouseDragged(int mousex, int mousey, int button, long heldTime) {
if (mouseDownSlot >= grid.realItems.size()) {
mouseDownSlot = -1;
}
if (this.groupingItem != null) {
final int overRowIndex = (mousey - grid.marginTop) / BookmarkGrid.SLOT_SIZE;
@@ -2241,8 +2244,7 @@ public class BookmarkPanel extends PanelWidget {
if (button == 0 && NEIClientUtils.shiftKey() && mouseDownSlot >= 0 && this.sortableItem == null) {
ItemPanelSlot mouseOverSlot = getSlotMouseOver(mousex, mousey);
if (grid.getItem(mouseDownSlot) != null
&& (mouseOverSlot == null || mouseOverSlot.slotIndex != mouseDownSlot || heldTime > 250)) {
if (mouseOverSlot == null || mouseOverSlot.slotIndex != mouseDownSlot || heldTime > 250) {
final BookmarkGrid BGrid = (BookmarkGrid) grid;
final ItemStackMetadata meta = BGrid.getMetadata(mouseDownSlot);
final List<ItemStack> items = new ArrayList<>();