Merge "Reset fullscreen task clipping" into tm-qpr-dev

This commit is contained in:
Vinit Nayak
2022-11-16 20:45:00 +00:00
committed by Android (Google) Code Review

View File

@@ -71,14 +71,20 @@ public class PreviewPositionHelper {
int deltaRotate = getRotationDelta(currentRotation, thumbnailRotation); int deltaRotate = getRotationDelta(currentRotation, thumbnailRotation);
RectF thumbnailClipHint = new RectF(); RectF thumbnailClipHint = new RectF();
float scaledTaskbarSize = 0; float scaledTaskbarSize;
float canvasScreenRatio;
if (mSplitBounds != null) { if (mSplitBounds != null) {
float fullscreenTaskWidth; float fullscreenTaskWidth;
float fullscreenTaskHeight; float fullscreenTaskHeight;
float canvasScreenRatio;
float taskPercent; 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 // For landscape, scale the width
taskPercent = mDesiredStagePosition == STAGE_POSITION_TOP_OR_LEFT taskPercent = mDesiredStagePosition == STAGE_POSITION_TOP_OR_LEFT
? mSplitBounds.leftTaskPercent ? mSplitBounds.leftTaskPercent
@@ -86,17 +92,12 @@ public class PreviewPositionHelper {
// Scale landscape width to that of actual screen // Scale landscape width to that of actual screen
fullscreenTaskWidth = screenWidthPx * taskPercent; fullscreenTaskWidth = screenWidthPx * taskPercent;
canvasScreenRatio = canvasWidth / fullscreenTaskWidth; canvasScreenRatio = canvasWidth / fullscreenTaskWidth;
}
} else { } else {
taskPercent = mDesiredStagePosition != STAGE_POSITION_TOP_OR_LEFT canvasScreenRatio = (float) canvasWidth / screenWidthPx;
? mSplitBounds.leftTaskPercent
: (1 - (mSplitBounds.leftTaskPercent + mSplitBounds.dividerWidthPercent));
// Scale landscape width to that of actual screen
fullscreenTaskHeight = screenHeightPx * taskPercent;
canvasScreenRatio = canvasHeight / fullscreenTaskHeight;
} }
scaledTaskbarSize = taskbarSize * canvasScreenRatio; scaledTaskbarSize = taskbarSize * canvasScreenRatio;
thumbnailClipHint.bottom = isTablet ? scaledTaskbarSize : 0; thumbnailClipHint.bottom = isTablet ? scaledTaskbarSize : 0;
}
float scale = thumbnailData.scale; float scale = thumbnailData.scale;
final float thumbnailScale; final float thumbnailScale;