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

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

Issue 2058543002: Updating initial zoom level for remote connections in Android Client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing CR Feedback Created 4 years, 6 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
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/DesktopCanvas.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/android/java/src/org/chromium/chromoting/TouchInputHandler.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/TouchInputHandler.java b/remoting/android/java/src/org/chromium/chromoting/TouchInputHandler.java
index 5ed6b968eef63f9fa8e5489ed867a9ec8f044193..ac55d627911d2d7e075a571b79b104a65505f5da 100644
--- a/remoting/android/java/src/org/chromium/chromoting/TouchInputHandler.java
+++ b/remoting/android/java/src/org/chromium/chromoting/TouchInputHandler.java
@@ -354,12 +354,22 @@ public class TouchInputHandler implements TouchInputHandlerInterface {
private void handleClientSizeChanged(int width, int height) {
mPanGestureBounds = new Rect(
mEdgeSlopInPx, mEdgeSlopInPx, width - mEdgeSlopInPx, height - mEdgeSlopInPx);
- mDesktopCanvas.repositionImageWithZoom(true);
+ resizeImageToFitScreen();
}
private void handleHostSizeChanged(int width, int height) {
- moveViewport((float) width / 2, (float) height / 2);
+ resizeImageToFitScreen();
+ }
+
+ private void resizeImageToFitScreen() {
mDesktopCanvas.resizeImageToFitScreen();
+ float screenCenterX;
+ float screenCenterY;
+ synchronized (mRenderData) {
+ screenCenterX = (float) mRenderData.screenWidth / 2;
+ screenCenterY = (float) mRenderData.screenHeight / 2;
+ }
+ moveCursorToScreenPoint(screenCenterX, screenCenterY);
}
private void setInputStrategy(InputStrategyInterface inputStrategy) {
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/DesktopCanvas.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698