events
This commit is contained in:
parent
60c882841f
commit
80233b7b72
@ -68,11 +68,11 @@ public final class Device {
|
|||||||
// the device may have been rotated since the event was generated, so ignore the event
|
// the device may have been rotated since the event was generated, so ignore the event
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Size deviceSize = screenInfo.getDeviceSize();
|
Rect contentRect = screenInfo.getContentRect();
|
||||||
Point point = position.getPoint();
|
Point point = position.getPoint();
|
||||||
int scaledX = point.x * deviceSize.getWidth() / videoSize.getWidth();
|
int deviceX = contentRect.left + point.x * contentRect.width() / videoSize.getWidth();
|
||||||
int scaledY = point.y * deviceSize.getHeight() / videoSize.getHeight();
|
int deviceY = contentRect.top + point.y * contentRect.height() / videoSize.getHeight();
|
||||||
return new Point(scaledX, scaledY);
|
return new Point(deviceX, deviceY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getDeviceName() {
|
public static String getDeviceName() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user