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

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

Fix casts to Math.round() in real landscape

Fixes: 248575056
Test: Wallpaper no longer bleeds through on split
animation in real landscape.

Change-Id: Ia59efda737de94a4b64f9d0a1f84cd116539107b
parent 3c8ae3ef
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -611,15 +611,17 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {

        if (desiredStagePosition == SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT) {
            if (isLandscape) {
                outRect.right = outRect.left + (int) (outRect.width() * topLeftTaskPercent);
                outRect.right = outRect.left + Math.round(outRect.width() * topLeftTaskPercent);
            } else {
                outRect.bottom = outRect.top + (int) (outRect.height() * topLeftTaskPercent);
                outRect.bottom = outRect.top + Math.round(outRect.height() * topLeftTaskPercent);
            }
        } else {
            if (isLandscape) {
                outRect.left += (int) (outRect.width() * (topLeftTaskPercent + dividerBarPercent));
                outRect.left += Math.round(outRect.width()
                        * (topLeftTaskPercent + dividerBarPercent));
            } else {
                outRect.top += (int) (outRect.height() * (topLeftTaskPercent + dividerBarPercent));
                outRect.top += Math.round(outRect.height()
                        * (topLeftTaskPercent + dividerBarPercent));
            }
        }
    }
@@ -632,7 +634,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
        int totalThumbnailHeight = parentHeight - spaceAboveSnapshot;
        int dividerBar = Math.round(splitBoundsConfig.appsStackedVertically
                ? splitBoundsConfig.dividerHeightPercent * totalThumbnailHeight
                : splitBoundsConfig.dividerWidthPercent * totalThumbnailHeight);
                : splitBoundsConfig.dividerWidthPercent * parentWidth);
        int primarySnapshotHeight;
        int primarySnapshotWidth;
        int secondarySnapshotHeight;
@@ -641,7 +643,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
                splitBoundsConfig.topTaskPercent : splitBoundsConfig.leftTaskPercent;
        if (dp.isLandscape) {
            primarySnapshotHeight = totalThumbnailHeight;
            primarySnapshotWidth = (int) (parentWidth * taskPercent);
            primarySnapshotWidth = Math.round(parentWidth * taskPercent);

            secondarySnapshotHeight = totalThumbnailHeight;
            secondarySnapshotWidth = parentWidth - primarySnapshotWidth - dividerBar;
@@ -656,7 +658,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
            secondarySnapshot.setTranslationY(spaceAboveSnapshot);
        } else {
            primarySnapshotWidth = parentWidth;
            primarySnapshotHeight = (int) (totalThumbnailHeight * taskPercent);
            primarySnapshotHeight = Math.round(totalThumbnailHeight * taskPercent);

            secondarySnapshotWidth = parentWidth;
            secondarySnapshotHeight = totalThumbnailHeight - primarySnapshotHeight - dividerBar;