mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 08:05:34 -04:00
Buttons cannot be moved out of the screen anymore
This commit is contained in:
parent
3ddd23da0e
commit
2fee70d77c
@ -8,6 +8,8 @@ import android.view.*;
|
||||
import android.view.View.*;
|
||||
import android.widget.*;
|
||||
|
||||
import androidx.core.math.MathUtils;
|
||||
|
||||
import net.kdt.pojavlaunch.customcontrols.ControlData;
|
||||
import net.kdt.pojavlaunch.customcontrols.ControlLayout;
|
||||
import net.kdt.pojavlaunch.customcontrols.handleview.*;
|
||||
@ -304,8 +306,8 @@ public class ControlButton extends androidx.appcompat.widget.AppCompatButton imp
|
||||
mCanTriggerLongClick = false;
|
||||
|
||||
if (!mProperties.isDynamicBtn) {
|
||||
setX(event.getRawX() - downX);
|
||||
setY(event.getRawY() - downY);
|
||||
setX(MathUtils.clamp(event.getRawX() - downX,0, CallbackBridge.physicalWidth));
|
||||
setY(MathUtils.clamp(event.getRawY() - downY, 0, CallbackBridge.physicalHeight));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user