Fix inventory scrollbar's drag state after mouse release (#1666)

This commit is contained in:
Ressed authored and GitHub committed 2026-09-28 12:32:57 +02:00
1 parent b50ef8d02c
commit 711c0dcb0a
2 files changed
+12

No files matched your search

@@ -572,6 +572,14 @@ public abstract class AEBaseGui extends GuiContainer implements IGuiTooltipHandl
super.mouseClickMove(x, y, c, d);
}
@Override
protected void mouseMovedOrUp(final int mouseX, final int mouseY, final int state) {
if (state >= 0 && this.getScrollBar() != null) {
this.getScrollBar().release();
}
super.mouseMovedOrUp(mouseX, mouseY, state);
}
@Override
protected void handleMouseClick(final Slot slot, final int slotIdx, final int clickedButton, final int clickType) {
if (clickType == 0 && this.draggedSlots.add(slot)) {
@@ -157,6 +157,10 @@ public class GuiScrollbar implements IScrollSource {
}
}
public void release() {
this.isLatestClickOnScrollbar = false;
}
public void wheel(int delta) {
delta = Math.max(Math.min(-delta, 1), -1);
this.currentScroll += delta * this.pageSize;