mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-12 06:05:10 -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;
|
||||
|
||||
import static net.kdt.pojavlaunch.Tools.currentDisplayMetrics;
|
||||
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.DEFAULT_PREF;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
@ -29,8 +28,6 @@ public class Touchpad extends View implements GrabListener, AbstractTouchpad {
|
||||
/* Mouse pointer icon used by the touchpad */
|
||||
private Drawable mMousePointerDrawable;
|
||||
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) {
|
||||
this(context, null);
|
||||
}
|
||||
@ -68,7 +65,7 @@ public class Touchpad extends View implements GrabListener, AbstractTouchpad {
|
||||
}
|
||||
|
||||
private void sendMousePosition() {
|
||||
CallbackBridge.sendCursorPos((mMouseX * mScaleFactor), (mMouseY * mScaleFactor));
|
||||
CallbackBridge.sendCursorPos((mMouseX * LauncherPreferences.PREF_SCALE_FACTOR), (mMouseY * LauncherPreferences.PREF_SCALE_FACTOR));
|
||||
}
|
||||
|
||||
private void updateMousePosition() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user