Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Unified Diff: remoting/android/java/src/org/chromium/chromoting/InputEventSender.java

Issue 2255663002: [Remoting Android] Use floating point coords for rendering the cursor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge ToT Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/android/java/src/org/chromium/chromoting/InputEventSender.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/InputEventSender.java b/remoting/android/java/src/org/chromium/chromoting/InputEventSender.java
index 514c2af1bd26b0d935dc595629f28ca87af16834..7aa072f17d8bdd0202c06cf795af9f9b9140dfdd 100644
--- a/remoting/android/java/src/org/chromium/chromoting/InputEventSender.java
+++ b/remoting/android/java/src/org/chromium/chromoting/InputEventSender.java
@@ -4,7 +4,7 @@
package org.chromium.chromoting;
-import android.graphics.Point;
+import android.graphics.PointF;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -35,35 +35,35 @@ public final class InputEventSender {
mPressedTextKeys = new TreeSet<>();
}
- public void sendMouseEvent(Point pos, int button, boolean down) {
+ public void sendMouseEvent(PointF pos, int button, boolean down) {
Preconditions.isTrue(button == InputStub.BUTTON_UNDEFINED
|| button == InputStub.BUTTON_LEFT
|| button == InputStub.BUTTON_MIDDLE
|| button == InputStub.BUTTON_RIGHT);
- mInjector.sendMouseEvent(pos.x, pos.y, button, down);
+ mInjector.sendMouseEvent((int) pos.x, (int) pos.y, button, down);
}
- public void sendMouseDown(Point pos, int button) {
+ public void sendMouseDown(PointF pos, int button) {
sendMouseEvent(pos, button, true);
}
- public void sendMouseUp(Point pos, int button) {
+ public void sendMouseUp(PointF pos, int button) {
sendMouseEvent(pos, button, false);
}
- public void sendMouseClick(Point pos, int button) {
+ public void sendMouseClick(PointF pos, int button) {
sendMouseDown(pos, button);
sendMouseUp(pos, button);
}
- public void sendCursorMove(Point pos) {
+ public void sendCursorMove(PointF pos) {
sendMouseUp(pos, InputStub.BUTTON_UNDEFINED);
}
// TODO(zijiehe): This function will be eventually removed after {@link InputStrategyInterface}
// has been deprecated.
- public void sendCursorMove(int x, int y) {
- sendCursorMove(new Point(x, y));
+ public void sendCursorMove(float x, float y) {
+ sendCursorMove(new PointF(x, y));
}
public void sendMouseWheelEvent(float distanceX, float distanceY) {

Powered by Google App Engine
This is Rietveld 408576698