diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/mouse/HotbarView.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/mouse/HotbarView.java index 640d65fbc..cd2ff5d1c 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/mouse/HotbarView.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/mouse/HotbarView.java @@ -94,7 +94,8 @@ public class HotbarView extends View implements MCOptionUtils.MCOptionListener, else mDropGesture.submit(); // Determine the hotbar slot float x = event.getX(); - if(x < 0 || x > mWidth) { + // Ignore positions equal to mWidth because they would translate into an out-of-bounds hotbar index + if(x < 0 || x >= mWidth) { // If out of bounds, cancel the hotbar gesture to avoid dropping items on last hotbar slots mDropGesture.cancel(); return true;