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

Commit 7afe8c90 authored by Winson's avatar Winson Committed by Winson Chung
Browse files

Fixing two small regressions in stack layout.

- Fixed issue with max scroll position being placed beyond the max
  scroll if the task height is larger than the stack height.
- Fixed issue with single task offsets being calculated incorrectly

Change-Id: I3cb1ecf2c13de7196bd68cd4f9d9f4f4736ed3ce
parent 54fdfaa3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -316,6 +316,7 @@ public class TaskStackLayoutAlgorithm {
            Log.d(TAG, "\tmFreeformRect: " + mFreeformRect);
            Log.d(TAG, "\tmFreeformStackRect: " + mFreeformStackRect);
            Log.d(TAG, "\tmStackRect: " + mStackRect);
            Log.d(TAG, "\tmCurrentStackRect: " + mCurrentStackRect);
            Log.d(TAG, "\tmTaskRect: " + mTaskRect);
            Log.d(TAG, "\tmSystemInsets: " + mSystemInsets);
        }
@@ -375,7 +376,7 @@ public class TaskStackLayoutAlgorithm {
                float normX = mUnfocusedCurveInterpolator.getX(bottomOffsetPct);
                mMinScrollP = 0;
                mMaxScrollP = Math.max(mMinScrollP,
                        (mNumStackTasks - 1) - mUnfocusedRange.getAbsoluteX(normX));
                        (mNumStackTasks - 1) - Math.max(0, mUnfocusedRange.getAbsoluteX(normX)));
            }
        }

@@ -570,7 +571,7 @@ public class TaskStackLayoutAlgorithm {
            p = (mMinScrollP - stackScroll) / mNumStackTasks;
            int centerYOffset = (mCurrentStackRect.top - mTaskRect.top) +
                    (mCurrentStackRect.height() - mTaskRect.height()) / 2;
            y = (int) (centerYOffset + (p * mCurrentStackRect.height()));
            y = centerYOffset + getYForDeltaP(p, 0);
            z = mMaxTranslationZ;
            relP = p;