A point is a 2D vector. A position represent a point relative to the screen size.master
parent
f70359f14f
commit
879941355d
@ -0,0 +1,42 @@
|
|||||||
|
package com.genymobile.scrcpy;
|
||||||
|
|
||||||
|
public class Position {
|
||||||
|
|
||||||
|
private int x;
|
||||||
|
private int y;
|
||||||
|
private int screenWidth;
|
||||||
|
private int screenHeight;
|
||||||
|
|
||||||
|
public Position(int x, int y, int screenWidth, int screenHeight) {
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.screenWidth = screenWidth;
|
||||||
|
this.screenHeight = screenHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getX() {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getY() {
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getScreenWidth() {
|
||||||
|
return screenWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getScreenHeight() {
|
||||||
|
return screenHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Point{" +
|
||||||
|
"x=" + x +
|
||||||
|
", y=" + y +
|
||||||
|
", screenWidth=" + screenWidth +
|
||||||
|
", screenHeight=" + screenHeight +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,27 +0,0 @@
|
|||||||
package com.genymobile.scrcpy;
|
|
||||||
|
|
||||||
public class RawPoint {
|
|
||||||
private int x;
|
|
||||||
private int y;
|
|
||||||
|
|
||||||
public RawPoint(int x, int y) {
|
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getX() {
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getY() {
|
|
||||||
return y;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "RawPoint{" +
|
|
||||||
"x=" + x +
|
|
||||||
", y=" + y +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in new issue