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

Commit 8d5e4bd6 authored by Andrii Kulian's avatar Andrii Kulian Committed by android-build-merger
Browse files

Merge "Round animation progress for computing size for background" into oc-dr1-dev

am: 75176be7

Change-Id: I526d743535c8c5d294f652765e7bb54146c017fb
parents 340a5319 75176be7
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -180,6 +180,11 @@ class SurfaceControlWithBackground extends SurfaceControl {
        // Compute new scaled width and height for background that will depend on current animation
        // Compute new scaled width and height for background that will depend on current animation
        // progress. Those consist of current crop rect for the main surface + scaled areas outside
        // progress. Those consist of current crop rect for the main surface + scaled areas outside
        // of letterboxed area.
        // of letterboxed area.
        // TODO: Because the progress is computed with low precision we're getting smaller values
        // for background width/height then screen size at the end of the animation. Will round when
        // the value is smaller then some empiric epsilon. However, this should be fixed by
        // computing correct frames for letterboxed windows in WindowState.
        d = d < 0.02f ? 0 : d;
        mWindowSurfaceController.getContainerRect(mTmpContainerRect);
        mWindowSurfaceController.getContainerRect(mTmpContainerRect);
        final int backgroundWidth =
        final int backgroundWidth =
                (int) (crop.width() + (mTmpContainerRect.width() - mLastWidth) * (1 - d) + 0.5);
                (int) (crop.width() + (mTmpContainerRect.width() - mLastWidth) * (1 - d) + 0.5);