Skip to content

Commit

Permalink
Fix[touchpad]: respond to dynamic scale changes
Browse files Browse the repository at this point in the history
artdeell committed Nov 20, 2024
1 parent 3f5baec commit 924c33c
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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 void placeMouseAt(float x, float y) {
}

private void sendMousePosition() {
CallbackBridge.sendCursorPos((mMouseX * mScaleFactor), (mMouseY * mScaleFactor));
CallbackBridge.sendCursorPos((mMouseX * LauncherPreferences.PREF_SCALE_FACTOR), (mMouseY * LauncherPreferences.PREF_SCALE_FACTOR));
}

private void updateMousePosition() {

0 comments on commit 924c33c

Please sign in to comment.