mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-11 13:45:48 -04:00
Fix[controls]: fix the hotbar out-of-bounds crashes
This commit is contained in:
parent
68254e0c8e
commit
cbaebec12a
@ -94,7 +94,8 @@ public class HotbarView extends View implements MCOptionUtils.MCOptionListener,
|
|||||||
else mDropGesture.submit();
|
else mDropGesture.submit();
|
||||||
// Determine the hotbar slot
|
// Determine the hotbar slot
|
||||||
float x = event.getX();
|
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
|
// If out of bounds, cancel the hotbar gesture to avoid dropping items on last hotbar slots
|
||||||
mDropGesture.cancel();
|
mDropGesture.cancel();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user