Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reverting the scaled coordinates fix for the tablet #11

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
applicationId "org.cagnulein.android_remote"
minSdkVersion 29
targetSdkVersion 32
versionCode 13
versionCode 16
versionName "2.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
setProperty("archivesBaseName", "android_remote")
Expand Down
Binary file modified app/src/main/assets/scrcpy-server.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions app/src/main/java/org/cagnulein/android_remote/Scrcpy.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public boolean touchevent(MotionEvent touch_event, int displayW, int displayH, b

int[] buf;
if(!landscape) {
buf = new int[]{touch_event.getAction(), touch_event.getButtonState(), (int) touch_event.getX() * screenWidth / displayW, (int) touch_event.getY() * screenHeight / displayH};
buf = new int[]{touch_event.getAction(), touch_event.getButtonState(), (int) touch_event.getX() * remote_dev_resolution[0] / displayW, (int) touch_event.getY() * remote_dev_resolution[1] / displayH};
} else {
buf = new int[]{touch_event.getAction(), touch_event.getButtonState(), (int) touch_event.getX() * screenHeight / displayW, (int) touch_event.getY() * screenWidth / displayH};
buf = new int[]{touch_event.getAction(), touch_event.getButtonState(), (int) touch_event.getX() * remote_dev_resolution[1] / displayW, (int) touch_event.getY() * remote_dev_resolution[0] / displayH};
}
String bufStr = Arrays.toString(buf).replaceAll(",", "");
logger.info("touchevent " + bufStr + " " + landscape + " " + displayW + " " + screenWidth + " " +displayH + " " + screenHeight);
Expand Down
7 changes: 4 additions & 3 deletions server/src/main/java/org/cagnulein/android_remote/Device.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ public Point NewgetPhysicalPoint(Point point) {
// Point point = position.getPoint();
int scaledX = point.x * deviceSize.getWidth() / videoSize.getWidth();
int scaledY = point.y * deviceSize.getHeight() / videoSize.getHeight();
if(isPortrait)
return new Point(point.x, scaledY);
/*if(isPortrait)
return new Point(scaledX, scaledY);
else
return new Point(scaledX, point.y);
return new Point(scaledX, scaledY);*/
return point;
}

public interface RotationListener {
Expand Down
Loading