mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 08:05:34 -04:00
Try fix scrolling
This commit is contained in:
parent
217f3997db
commit
bfec5cdd44
@ -360,7 +360,7 @@ public class MainActivity extends LoggableActivity implements OnTouchListener, O
|
|||||||
glTouchListener = new OnTouchListener(){
|
glTouchListener = new OnTouchListener(){
|
||||||
private boolean isTouchInHotbar = false;
|
private boolean isTouchInHotbar = false;
|
||||||
private int hotbarX, hotbarY;
|
private int hotbarX, hotbarY;
|
||||||
private int scrollInitialX, scrollInitialY, scrollX, scrollY;
|
private int scrollInitialX, scrollInitialY;
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouch(View p1, MotionEvent e)
|
public boolean onTouch(View p1, MotionEvent e)
|
||||||
{
|
{
|
||||||
@ -398,9 +398,6 @@ public class MainActivity extends LoggableActivity implements OnTouchListener, O
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CallbackBridge.isGrabbing()) {
|
if (CallbackBridge.isGrabbing()) {
|
||||||
scrollX = 0;
|
|
||||||
scrollY = 0;
|
|
||||||
|
|
||||||
// It cause hold left mouse while moving camera
|
// It cause hold left mouse while moving camera
|
||||||
// CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0, (byte) 1, x, y);
|
// CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0, (byte) 1, x, y);
|
||||||
initialX = x;
|
initialX = x;
|
||||||
@ -448,20 +445,17 @@ public class MainActivity extends LoggableActivity implements OnTouchListener, O
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
||||||
scrollX = Math.max(0, scrollX + x - scrollInitialX);
|
case MotionEvent.ACTION_POINTER_INDEX_SHIFT:
|
||||||
scrollY = Math.max(0, scrollY + y - scrollInitialY);
|
CallbackBridge.sendScroll(x - scrollInitialX, y - scrollInitialY);
|
||||||
|
|
||||||
CallbackBridge.sendScroll(scrollX, scrollY);
|
|
||||||
|
|
||||||
scrollInitialX = x;
|
scrollInitialX = x;
|
||||||
scrollInitialY = y;
|
scrollInitialY = y;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MotionEvent.ACTION_POINTER_UP: // 6
|
case MotionEvent.ACTION_POINTER_UP: // 6
|
||||||
scrollInitialX = x;
|
scrollInitialX = x;
|
||||||
scrollInitialY = y;
|
scrollInitialY = y;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// TODO implement GLFWScrollCallback to ACTION_SCROLL
|
|
||||||
default:
|
default:
|
||||||
if (!isTouchInHotbar) {
|
if (!isTouchInHotbar) {
|
||||||
CallbackBridge.mouseX = x;
|
CallbackBridge.mouseX = x;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user