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

Commit c6fcd76d authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Reset fullscreen task clipping

* Accidentally removed fullscreen task clipping
and put it in the split block
* Also fixed a copy/pasta bug where we were always looking
at the leftTaskPercet instead of topTaskPercent for portrait
split

Fixes: 258714015
Test: FullscreenDrawParamsTest passes
Change-Id: If9419f50218a912ce85d992a874cb983b08a946a
parent 99be1de5
Loading
Loading
Loading
Loading
+13 −12
Original line number Diff line number Diff line
@@ -71,14 +71,20 @@ public class PreviewPositionHelper {
        int deltaRotate = getRotationDelta(currentRotation, thumbnailRotation);
        RectF thumbnailClipHint = new RectF();

        float scaledTaskbarSize = 0;
        float scaledTaskbarSize;
        float canvasScreenRatio;
        if (mSplitBounds != null) {
            float fullscreenTaskWidth;
            float fullscreenTaskHeight;
            float canvasScreenRatio;

            float taskPercent;
            if (!mSplitBounds.appsStackedVertically) {
            if (mSplitBounds.appsStackedVertically) {
                taskPercent = mDesiredStagePosition != STAGE_POSITION_TOP_OR_LEFT
                        ? mSplitBounds.topTaskPercent
                        : (1 - (mSplitBounds.topTaskPercent + mSplitBounds.dividerHeightPercent));
                fullscreenTaskHeight = screenHeightPx * taskPercent;
                canvasScreenRatio = canvasHeight / fullscreenTaskHeight;
            } else {
                // For landscape, scale the width
                taskPercent = mDesiredStagePosition == STAGE_POSITION_TOP_OR_LEFT
                        ? mSplitBounds.leftTaskPercent
@@ -86,17 +92,12 @@ public class PreviewPositionHelper {
                // Scale landscape width to that of actual screen
                fullscreenTaskWidth = screenWidthPx * taskPercent;
                canvasScreenRatio = canvasWidth / fullscreenTaskWidth;
            }
        } else {
                taskPercent = mDesiredStagePosition != STAGE_POSITION_TOP_OR_LEFT
                        ? mSplitBounds.leftTaskPercent
                        : (1 - (mSplitBounds.leftTaskPercent + mSplitBounds.dividerWidthPercent));
                // Scale landscape width to that of actual screen
                fullscreenTaskHeight = screenHeightPx * taskPercent;
                canvasScreenRatio = canvasHeight / fullscreenTaskHeight;
            canvasScreenRatio = (float) canvasWidth / screenWidthPx;
        }
        scaledTaskbarSize = taskbarSize * canvasScreenRatio;
        thumbnailClipHint.bottom = isTablet ? scaledTaskbarSize : 0;
        }

        float scale = thumbnailData.scale;
        final float thumbnailScale;