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

Commit ed78ab7e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Clamp ripple starting x/y further"

parents 3303512c 92aef5d9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ class RippleForeground extends RippleComponent {

        // Take 60% of the maximum of the width and height, then divided half to get the radius.
        mStartRadius = Math.max(bounds.width(), bounds.height()) * 0.3f;
        clampStartingPosition();
    }

    @Override
@@ -350,7 +351,7 @@ class RippleForeground extends RippleComponent {
        final float cY = mBounds.exactCenterY();
        final float dX = mStartingX - cX;
        final float dY = mStartingY - cY;
        final float r = mTargetRadius;
        final float r = mTargetRadius - mStartRadius;
        if (dX * dX + dY * dY > r * r) {
            // Point is outside the circle, clamp to the perimeter.
            final double angle = Math.atan2(dY, dX);