| 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 int pointerCount = e2.getPointerCount(); | 449 int pointerCount = e2.getPointerCount(); |
| 450 | 450 |
| 451 // Check to see if the motion originated at the edge of the screen. | 451 // Check to see if the motion originated at the edge of the screen. |
| 452 // If so, then the user is likely swiping in to display system UI. | 452 // If so, then the user is likely swiping in to display system UI. |
| 453 if (!mPanGestureBounds.contains((int) e1.getX(), (int) e1.getY())) { | 453 if (!mPanGestureBounds.contains((int) e1.getX(), (int) e1.getY())) { |
| 454 // Prevent the cursor being moved or flung by the gesture. | 454 // Prevent the cursor being moved or flung by the gesture. |
| 455 mSuppressCursorMovement = true; | 455 mSuppressCursorMovement = true; |
| 456 return false; | 456 return false; |
| 457 } | 457 } |
| 458 | 458 |
| 459 if (pointerCount == 3 && !mSwipeCompleted) { | 459 if (pointerCount >= 3 && !mSwipeCompleted) { |
| 460 // Note that distance values are reversed. For example, dragging
a finger in the | 460 // Note that distance values are reversed. For example, dragging
a finger in the |
| 461 // direction of increasing Y coordinate (downwards) results in d
istanceY being | 461 // direction of increasing Y coordinate (downwards) results in d
istanceY being |
| 462 // negative. | 462 // negative. |
| 463 mTotalMotionY -= distanceY; | 463 mTotalMotionY -= distanceY; |
| 464 return onSwipe(); | 464 return onSwipe(); |
| 465 } | 465 } |
| 466 | 466 |
| 467 if (pointerCount == 2 && mSwipePinchDetector.isSwiping()) { | 467 if (pointerCount == 2 && mSwipePinchDetector.isSwiping()) { |
| 468 if (!mInputStrategy.isIndirectInputMode()) { | 468 if (!mInputStrategy.isIndirectInputMode()) { |
| 469 // Ensure the cursor is located at the coordinates of the or
iginal event, | 469 // Ensure the cursor is located at the coordinates of the or
iginal event, |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 imageWidth = mRenderData.imageWidth; | 637 imageWidth = mRenderData.imageWidth; |
| 638 imageHeight = mRenderData.imageHeight; | 638 imageHeight = mRenderData.imageHeight; |
| 639 } | 639 } |
| 640 screenToImage.mapPoints(mappedPoints); | 640 screenToImage.mapPoints(mappedPoints); |
| 641 | 641 |
| 642 return (mappedPoints[0] >= 0 && mappedPoints[0] <= imageWidth) | 642 return (mappedPoints[0] >= 0 && mappedPoints[0] <= imageWidth) |
| 643 && (mappedPoints[1] >= 0 && mappedPoints[1] <= imageHeight); | 643 && (mappedPoints[1] >= 0 && mappedPoints[1] <= imageHeight); |
| 644 } | 644 } |
| 645 } | 645 } |
| 646 } | 646 } |
| OLD | NEW |