Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f36c5be authored by Ben Lin's avatar Ben Lin
Browse files

PiP: Constrain pinch-resize input to start inside PiP bounds.

Previously, we just check for any two down input event - but they should
both be inside the PiP bounds for the gesture to start.

Bug: 184789307
Test: Manual. Have only one finger inside PiP and one finger outside and
try to pinch, no longer resizes.

Change-Id: Ia2193f8d754423013e98d08399f00e665d353b14
parent 18ecd981
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -380,14 +380,17 @@ public class PipResizeGestureHandler {
            return;
        }

        final Rect pipBounds = mPipBoundsState.getBounds();
        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;
                mFirstIndex = 0;
                mSecondIndex = 1;
                mDownPoint.set(ev.getRawX(mFirstIndex), ev.getRawY(mFirstIndex));
                mDownSecondPoint.set(ev.getRawX(mSecondIndex), ev.getRawY(mSecondIndex));
                mDownBounds.set(mPipBoundsState.getBounds());
                mDownBounds.set(pipBounds);

                mLastPoint.set(mDownPoint);
                mLastSecondPoint.set(mLastSecondPoint);