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

Commit 8a8b1f63 authored by Ben Lin's avatar Ben Lin
Browse files

PiP: Divide up the magnetic percent by 2.

At max size, doing a brute percentage calculation using width / minWidth
ends up with a magnetic distance that's too big. Divide by 2 again to
make it more natural.

Bug: 190657668
Test: Pinch to max size, drag down - doesn't immediate snap to it
anymore

Change-Id: Ib5de742b753239a151686c1a85b27a6fe553a577
parent 53c5d85b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -536,8 +536,9 @@ public class PipResizeGestureHandler {
                mPipTaskOrganizer.scheduleFinishResizePip(mLastResizeBounds,
                        PipAnimationController.TRANSITION_DIRECTION_USER_RESIZE, callback);
            }
            final float magnetRadiusPercent = (float) mLastResizeBounds.width() / mMinSize.x / 2.f;
            mPipDismissTargetHandler
                    .setMagneticFieldRadiusPercent((float) mLastResizeBounds.width() / mMinSize.x);
                    .setMagneticFieldRadiusPercent(magnetRadiusPercent);
            mPipUiEventLogger.log(
                    PipUiEventLogger.PipUiEventEnum.PICTURE_IN_PICTURE_RESIZE);
        } else {