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

Commit ac6b4a4d authored by Nader Jawad's avatar Nader Jawad Committed by Automerger Merge Worker
Browse files

Merge "Fixed issue with invalid stretch params" into sc-dev am: 93ea53bb

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14163043

Change-Id: I1bd1c4e41c582ab7e7df09aad853e6d710b5208a
parents 2f67e870 93ea53bb
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -626,20 +626,14 @@ public class EdgeEffect {
            // assume rotations of increments of 90 degrees
            float x = mTmpPoints[10] - mTmpPoints[8];
            float width = right - left;
            float vecX = 0f;
            if (width > 0) {
                vecX = dampStretchVector(Math.max(-1f, Math.min(1f, x / width)));
            }
            float vecX = dampStretchVector(Math.max(-1f, Math.min(1f, x / width)));

            float y = mTmpPoints[11] - mTmpPoints[9];
            float height = bottom - top;
            float vecY = 0f;
            if (height > 0) {
                vecY = dampStretchVector(Math.max(-1f, Math.min(1f, y / height)));
            }
            float vecY = dampStretchVector(Math.max(-1f, Math.min(1f, y / height)));

            boolean hasStretchVectors = Float.compare(vecX, 0) != 0 || Float.compare(vecY, 0) != 0;
            if (right > left && bottom > top && mWidth > 0 && mHeight > 0 && hasStretchVectors) {
            boolean hasValidVectors = Float.isFinite(vecX) && Float.isFinite(vecY);
            if (right > left && bottom > top && mWidth > 0 && mHeight > 0 && hasValidVectors) {
                renderNode.stretch(
                        left,
                        top,