mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
Fix workspace scale calculation
- Based on workspace page instead of workspace (takes padding into account) - Checks that width != 0 so we don't divide by 0 Bug: 79526164 Change-Id: I25d92a04550aa34abab7e9e1f93c93dbccd61752
This commit is contained in:
@@ -50,8 +50,11 @@ public class OverviewState extends LauncherState {
|
||||
public float[] getWorkspaceScaleAndTranslation(Launcher launcher) {
|
||||
RecentsView recentsView = launcher.getOverviewPanel();
|
||||
Workspace workspace = launcher.getWorkspace();
|
||||
View workspacePage = workspace.getPageAt(workspace.getCurrentPage());
|
||||
float workspacePageWidth = workspacePage != null && workspacePage.getWidth() != 0
|
||||
? workspacePage.getWidth() : launcher.getDeviceProfile().availableWidthPx;
|
||||
recentsView.getTaskSize(sTempRect);
|
||||
float scale = (float) sTempRect.width() / workspace.getWidth();
|
||||
float scale = (float) sTempRect.width() / workspacePageWidth;
|
||||
float parallaxFactor = 0.4f;
|
||||
return new float[]{scale, 0, -getDefaultSwipeHeight(launcher) * parallaxFactor};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user