Merge "PiP: Constrain pinch-resize input to start inside PiP bounds." into sc-dev
This commit is contained in:
@@ -383,14 +383,17 @@ public class PipResizeGestureHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final Rect pipBounds = mPipBoundsState.getBounds();
|
||||||
if (action == MotionEvent.ACTION_POINTER_DOWN) {
|
if (action == MotionEvent.ACTION_POINTER_DOWN) {
|
||||||
if (mFirstIndex == -1 && mSecondIndex == -1) {
|
if (mFirstIndex == -1 && mSecondIndex == -1
|
||||||
|
&& pipBounds.contains((int) ev.getRawX(0), (int) ev.getRawY(0))
|
||||||
|
&& pipBounds.contains((int) ev.getRawX(1), (int) ev.getRawY(1))) {
|
||||||
mAllowGesture = true;
|
mAllowGesture = true;
|
||||||
mFirstIndex = 0;
|
mFirstIndex = 0;
|
||||||
mSecondIndex = 1;
|
mSecondIndex = 1;
|
||||||
mDownPoint.set(ev.getRawX(mFirstIndex), ev.getRawY(mFirstIndex));
|
mDownPoint.set(ev.getRawX(mFirstIndex), ev.getRawY(mFirstIndex));
|
||||||
mDownSecondPoint.set(ev.getRawX(mSecondIndex), ev.getRawY(mSecondIndex));
|
mDownSecondPoint.set(ev.getRawX(mSecondIndex), ev.getRawY(mSecondIndex));
|
||||||
mDownBounds.set(mPipBoundsState.getBounds());
|
mDownBounds.set(pipBounds);
|
||||||
|
|
||||||
mLastPoint.set(mDownPoint);
|
mLastPoint.set(mDownPoint);
|
||||||
mLastSecondPoint.set(mLastSecondPoint);
|
mLastSecondPoint.set(mLastSecondPoint);
|
||||||
|
|||||||
Reference in New Issue
Block a user