mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 18:06:48 +00:00
Prevent edit state workspace scale from hiding next pages.
Fix: 228969651 Test: manual Change-Id: I0cceb3bfab19e0721b21fb8c55fe1218b1f25af8
This commit is contained in:
@@ -53,7 +53,15 @@ public class SpringLoadedState extends LauncherState {
|
||||
|
||||
float shrunkTop = grid.getWorkspaceSpringLoadShrunkTop();
|
||||
float shrunkBottom = grid.getWorkspaceSpringLoadShrunkBottom();
|
||||
float scale = (shrunkBottom - shrunkTop) / ws.getNormalChildHeight();
|
||||
float scale = Math.min((shrunkBottom - shrunkTop) / ws.getNormalChildHeight(), 1f);
|
||||
|
||||
// Reduce scale if next pages would not be visible after scaling the workspace
|
||||
float scaledWorkspaceWidth = ws.getWidth() * scale;
|
||||
float maxAvailableWidth =
|
||||
ws.getWidth() - (2 * grid.getWorkspaceSpringLoadedMinimumNextPageVisible());
|
||||
if (scaledWorkspaceWidth > maxAvailableWidth) {
|
||||
scale *= maxAvailableWidth / scaledWorkspaceWidth;
|
||||
}
|
||||
|
||||
float halfHeight = ws.getHeight() / 2;
|
||||
float myCenter = ws.getTop() + halfHeight;
|
||||
|
||||
Reference in New Issue
Block a user