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

Commit e4579b2a authored by Hongwei Wang's avatar Hongwei Wang Committed by Android (Google) Code Review
Browse files

Merge "Fixes the PiP edge intersect for fling"

parents f3854661 02e3c9d0
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -24,8 +24,6 @@ import android.graphics.PointF;
import android.graphics.Rect;
import android.util.Size;
import android.view.Gravity;
import android.view.ViewConfiguration;
import android.widget.Scroller;

import java.io.PrintWriter;
import java.util.ArrayList;
@@ -180,14 +178,6 @@ public class PipSnapAlgorithm {
        // If we're not flinging along the current edge, find the closest point instead.
        final double distanceVert = Math.hypot(vertPoint.x - x, vertPoint.y - y);
        final double distanceHoriz = Math.hypot(horizPoint.x - x, horizPoint.y - y);
        // Ensure that we're actually going somewhere
        if (distanceVert == 0) {
            return horizPoint;
        }
        if (distanceHoriz == 0) {
            return vertPoint;
        }
        // Otherwise use the closest point
        return Math.abs(distanceVert) > Math.abs(distanceHoriz) ? horizPoint : vertPoint;
    }