mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-12 22:26:56 -04:00
Fix[touchpad]: respond to dynamic scale changes
This commit is contained in:
parent
3f5baec1e6
commit
924c33cb2c
@ -1,7 +1,6 @@
|
|||||||
package net.kdt.pojavlaunch.customcontrols.mouse;
|
package net.kdt.pojavlaunch.customcontrols.mouse;
|
||||||
|
|
||||||
import static net.kdt.pojavlaunch.Tools.currentDisplayMetrics;
|
import static net.kdt.pojavlaunch.Tools.currentDisplayMetrics;
|
||||||
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.DEFAULT_PREF;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
@ -29,8 +28,6 @@ public class Touchpad extends View implements GrabListener, AbstractTouchpad {
|
|||||||
/* Mouse pointer icon used by the touchpad */
|
/* Mouse pointer icon used by the touchpad */
|
||||||
private Drawable mMousePointerDrawable;
|
private Drawable mMousePointerDrawable;
|
||||||
private float mMouseX, mMouseY;
|
private float mMouseX, mMouseY;
|
||||||
/* Resolution scaler option, allow downsizing a window */
|
|
||||||
private final float mScaleFactor = DEFAULT_PREF.getInt("resolutionRatio",100)/100f;
|
|
||||||
public Touchpad(@NonNull Context context) {
|
public Touchpad(@NonNull Context context) {
|
||||||
this(context, null);
|
this(context, null);
|
||||||
}
|
}
|
||||||
@ -68,7 +65,7 @@ public class Touchpad extends View implements GrabListener, AbstractTouchpad {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void sendMousePosition() {
|
private void sendMousePosition() {
|
||||||
CallbackBridge.sendCursorPos((mMouseX * mScaleFactor), (mMouseY * mScaleFactor));
|
CallbackBridge.sendCursorPos((mMouseX * LauncherPreferences.PREF_SCALE_FACTOR), (mMouseY * LauncherPreferences.PREF_SCALE_FACTOR));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateMousePosition() {
|
private void updateMousePosition() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user