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

Commit fa83834a authored by Tim Murray's avatar Tim Murray
Browse files

Avoid unnecessary division in TextView.Marquee.tick.

Test: Marquee.tick works
Change-Id: Idb2c1cadb6b49009f8bec45ad44a34f5636c0e79
parent 53b2d749
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -11879,7 +11879,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        private final Choreographer mChoreographer;

        private byte mStatus = MARQUEE_STOPPED;
        private final float mPixelsPerSecond;
        private final float mPixelsPerMs;
        private float mMaxScroll;
        private float mMaxFadeScroll;
        private float mGhostStart;
@@ -11892,7 +11892,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener

        Marquee(TextView v) {
            final float density = v.getContext().getResources().getDisplayMetrics().density;
            mPixelsPerSecond = MARQUEE_DP_PER_SECOND * density;
            mPixelsPerMs = MARQUEE_DP_PER_SECOND * density / 1000f;
            mView = new WeakReference<TextView>(v);
            mChoreographer = Choreographer.getInstance();
        }
@@ -11937,7 +11937,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                long currentMs = mChoreographer.getFrameTime();
                long deltaMs = currentMs - mLastAnimationMs;
                mLastAnimationMs = currentMs;
                float deltaPx = deltaMs / 1000f * mPixelsPerSecond;
                float deltaPx = deltaMs * mPixelsPerMs;
                mScroll += deltaPx;
                if (mScroll > mMaxScroll) {
                    mScroll = mMaxScroll;