mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2026-08-01 14:19:12 -06:00
Sliding inset values (mouse doesn't work right)
This commit is contained in:
parent
dd25be1bb8
commit
99d619705c
3 changed files with 18 additions and 6 deletions
|
|
@ -276,8 +276,12 @@ public class GLFWGLSurface extends View implements GrabListener {
|
|||
//Getting scaled position from the event
|
||||
/* Tells if a double tap happened [MOUSE GRAB ONLY]. Doesn't tell where though. */
|
||||
if(!CallbackBridge.isGrabbing()) {
|
||||
CallbackBridge.mouseX = (e.getX() * mScaleFactor);
|
||||
CallbackBridge.mouseY = (e.getY() * mScaleFactor);
|
||||
float scaledInsetX = PREF_INSET_X * mScaleFactor;
|
||||
float scaledInsetY = PREF_INSET_X * mScaleFactor; // Assuming you have a Y inset as well
|
||||
|
||||
CallbackBridge.mouseX = (e.getX() * mScaleFactor) - scaledInsetX;
|
||||
CallbackBridge.mouseY = (e.getY() * mScaleFactor) - scaledInsetY;
|
||||
|
||||
//One android click = one MC click
|
||||
if(mSingleTapDetector.onTouchEvent(e)){ //
|
||||
//longPressDetector.onTouchEvent(e);// Touch Mode
|
||||
|
|
@ -506,8 +510,11 @@ public class GLFWGLSurface extends View implements GrabListener {
|
|||
@RequiresApi(26)
|
||||
@Override
|
||||
public boolean dispatchCapturedPointerEvent(MotionEvent e) {
|
||||
CallbackBridge.mouseX += (e.getX()* mScaleFactor);
|
||||
CallbackBridge.mouseY += (e.getY()* mScaleFactor);
|
||||
float scaledInsetX = PREF_INSET_X * mScaleFactor;
|
||||
float scaledInsetY = PREF_INSET_X * mScaleFactor; // Assuming you have a Y inset as well
|
||||
|
||||
CallbackBridge.mouseX = (e.getX() * mScaleFactor) - scaledInsetX;
|
||||
CallbackBridge.mouseY = (e.getY() * mScaleFactor) - scaledInsetY;
|
||||
|
||||
switch (e.getActionMasked()) {
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package net.kdt.pojavlaunch;
|
||||
|
||||
import static net.kdt.pojavlaunch.Tools.currentDisplayMetrics;
|
||||
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_INSET_X;
|
||||
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_SUSTAINED_PERFORMANCE;
|
||||
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_USE_ALTERNATE_SURFACE;
|
||||
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_VIRTUAL_MOUSE_START;
|
||||
|
|
@ -70,6 +71,7 @@ public class MainActivity extends BaseActivity implements ControlButtonMenuListe
|
|||
private DrawerLayout drawerLayout;
|
||||
private ListView navDrawer;
|
||||
private View mDrawerPullButton;
|
||||
private View contentFrame;
|
||||
private GyroControl mGyroControl = null;
|
||||
public static ControlLayout mControlLayout;
|
||||
|
||||
|
|
@ -206,6 +208,9 @@ public class MainActivity extends BaseActivity implements ControlButtonMenuListe
|
|||
mControlLayout = findViewById(R.id.main_control_layout);
|
||||
touchCharInput = findViewById(R.id.mainTouchCharInput);
|
||||
mDrawerPullButton = findViewById(R.id.drawer_button);
|
||||
contentFrame = findViewById(R.id.content_frame);
|
||||
int inset = (int) PREF_INSET_X*2;
|
||||
contentFrame.setPadding(inset,inset,inset,inset);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:icon="@drawable/ic_setting_gesture_time"
|
||||
android:key="xinset"
|
||||
android:summary=""Hello""
|
||||
android:title=""Example""
|
||||
android:summary="Custom Insets"
|
||||
android:title="Inset the gameframe"
|
||||
app2:seekBarIncrement="10"
|
||||
app2:selectable="false"
|
||||
app2:showSeekBarValue="true" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue