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

Commit e1b5e577 authored by Brian Attwell's avatar Brian Attwell Committed by Android Git Automerger
Browse files

am 15195ee5: Don\'t pass invalid/infinite values into setScale()

* commit '15195ee5':
  Don't pass invalid/infinite values into setScale()
parents eee4e2a5 15195ee5
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -885,13 +885,18 @@ public class MultiShrinkScroller extends FrameLayout {
            return;
        }

        float ratio = (toolbarHeight  - mMinimumHeaderHeight)
        final float ratio = (toolbarHeight  - mMinimumHeaderHeight)
                / (float)(mMaximumHeaderHeight - mMinimumHeaderHeight);
        final float minimumSize = mInvisiblePlaceholderTextView.getHeight();
        final float bezierOutput = mTextSizePathInterpolator.getInterpolation(ratio);
        float bezierOutput = mTextSizePathInterpolator.getInterpolation(ratio);
        float scale = (minimumSize + (mMaximumHeaderTextSize - minimumSize) * bezierOutput)
                / mMaximumHeaderTextSize;

        // Clamp to reasonable/finite values before passing into framework. The values
        // can be wacky before the first pre-render.
        bezierOutput = (float) Math.min(bezierOutput, 1.0f);
        scale = (float) Math.min(scale, 1.0f);

        mLargeTextView.setScaleX(scale);
        mLargeTextView.setScaleY(scale);
        setInterpolatedTitleMargins(bezierOutput);