mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 23:59:21 -04:00
Fix jumping when jungling between pointers
This commit is contained in:
parent
a3fb8317b6
commit
7ed4607bc8
@ -321,6 +321,7 @@ public class BaseMainActivity extends LoggableActivity {
|
||||
private boolean isTouchInHotbar = false;
|
||||
private int hotbarX, hotbarY;
|
||||
private float prevX, prevY;
|
||||
private int currentPointerID;
|
||||
@Override
|
||||
public boolean onTouch(View p1, MotionEvent e) {
|
||||
|
||||
@ -375,6 +376,7 @@ public class BaseMainActivity extends LoggableActivity {
|
||||
|
||||
theHandler.sendEmptyMessageDelayed(BaseMainActivity.MSG_DROP_ITEM_BUTTON_CHECK, LauncherPreferences.PREF_LONGPRESS_TRIGGER);
|
||||
} else {
|
||||
currentPointerID = e.getPointerId(0);
|
||||
CallbackBridge.mouseX = mouse_x;
|
||||
CallbackBridge.mouseY = mouse_y;
|
||||
prevX = e.getX();
|
||||
@ -452,17 +454,15 @@ public class BaseMainActivity extends LoggableActivity {
|
||||
}
|
||||
}
|
||||
|
||||
/*if(e.getHistorySize() > 0 && CallbackBridge.isGrabbing()) {
|
||||
mouse_x += (int)(e.getX() - e.getHistoricalX(0))*4;
|
||||
mouse_y += (int)(e.getY() - e.getHistoricalY(0))*4;
|
||||
}*/
|
||||
if(CallbackBridge.isGrabbing()){
|
||||
if(e.getActionMasked() == MotionEvent.ACTION_MOVE){
|
||||
if(e.getPointerId(0) != currentPointerID){
|
||||
currentPointerID = e.getPointerId(0);
|
||||
}else{
|
||||
mouse_x += (int) (e.getX() - prevX);
|
||||
mouse_y += (int) (e.getY() - prevY);
|
||||
prevX = e.getX();
|
||||
prevY = e.getY();
|
||||
}
|
||||
prevX = e.getX();
|
||||
prevY = e.getY();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user