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

Commit dafee65f authored by Adam Powell's avatar Adam Powell
Browse files

Fix for unexpected scale factors in ScaleGestureDetector

Provided by levischmidt@google.com

Test: cts: atest ScaleGestureDetector
Fixes: 122328202
Change-Id: Ie229c39f65e4ac72a3f8e22317633f648f7fa008
parent 5e056276
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -551,7 +551,7 @@ public class ScaleGestureDetector {
                    (mEventBeforeOrAboveStartingGestureEvent && (mCurrSpan < mPrevSpan)) ||
                    (!mEventBeforeOrAboveStartingGestureEvent && (mCurrSpan > mPrevSpan));
            final float spanDiff = (Math.abs(1 - (mCurrSpan / mPrevSpan)) * SCALE_FACTOR);
            return mPrevSpan <= 0 ? 1 : scaleUp ? (1 + spanDiff) : (1 - spanDiff);
            return mPrevSpan <= mSpanSlop ? 1 : scaleUp ? (1 + spanDiff) : (1 - spanDiff);
        }
        return mPrevSpan > 0 ? mCurrSpan / mPrevSpan : 1;
    }