| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chromoting; | 5 package org.chromium.chromoting; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.graphics.Matrix; | 8 import android.graphics.Matrix; |
| 9 import android.graphics.Point; | 9 import android.graphics.Point; |
| 10 import android.graphics.PointF; | 10 import android.graphics.PointF; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 @Override | 103 @Override |
| 104 protected void processAction(float deltaX, float deltaY) { | 104 protected void processAction(float deltaX, float deltaY) { |
| 105 float[] delta = {deltaX, deltaY}; | 105 float[] delta = {deltaX, deltaY}; |
| 106 synchronized (mRenderData) { | 106 synchronized (mRenderData) { |
| 107 Matrix canvasToImage = new Matrix(); | 107 Matrix canvasToImage = new Matrix(); |
| 108 mRenderData.transform.invert(canvasToImage); | 108 mRenderData.transform.invert(canvasToImage); |
| 109 canvasToImage.mapVectors(delta); | 109 canvasToImage.mapVectors(delta); |
| 110 } | 110 } |
| 111 | 111 |
| 112 moveViewportWithOffset(-deltaX, -deltaY); | 112 moveViewportWithOffset(-delta[0], -delta[1]); |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 /** | 116 /** |
| 117 * This class implements fling animation for scrolling | 117 * This class implements fling animation for scrolling |
| 118 */ | 118 */ |
| 119 private class ScrollAnimationJob extends FlingAnimationJob { | 119 private class ScrollAnimationJob extends FlingAnimationJob { |
| 120 public ScrollAnimationJob(Context context) { | 120 public ScrollAnimationJob(Context context) { |
| 121 super(context); | 121 super(context); |
| 122 } | 122 } |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 case 2: | 654 case 2: |
| 655 return InputStub.BUTTON_RIGHT; | 655 return InputStub.BUTTON_RIGHT; |
| 656 case 3: | 656 case 3: |
| 657 return InputStub.BUTTON_MIDDLE; | 657 return InputStub.BUTTON_MIDDLE; |
| 658 default: | 658 default: |
| 659 return InputStub.BUTTON_UNDEFINED; | 659 return InputStub.BUTTON_UNDEFINED; |
| 660 } | 660 } |
| 661 } | 661 } |
| 662 } | 662 } |
| 663 } | 663 } |
| OLD | NEW |