summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2011-11-18 10:16:53 -0800
committerAdam Cohen <adamcohen@google.com>2011-11-18 10:16:53 -0800
commitbad24941cdc9fd6bfa17f90a72157466b7b00f68 (patch)
tree1ca0708dbbbeff86ad078d7cfe1b383a7b086ecd /src
parent2cf7a80c87b07d2e729ef6c86d547a33b49db47d (diff)
downloadpackages_apps_trebuchet-bad24941cdc9fd6bfa17f90a72157466b7b00f68.zip
packages_apps_trebuchet-bad24941cdc9fd6bfa17f90a72157466b7b00f68.tar.gz
packages_apps_trebuchet-bad24941cdc9fd6bfa17f90a72157466b7b00f68.tar.bz2
Small fix to deal with ugly widget dropping situations
-> Tried some more elaborate fixes in which aspect ratio of the preview were not preserved. Given that nothing clearly always better, going with a simple fix for now. Change-Id: I3dccf95680da55cccfb6f00befe88cea4bbe0035
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/Workspace.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 8ac5248..ae71761 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -2960,7 +2960,8 @@ public class Workspace extends SmoothPagedView
mLauncher.getDragLayer().getDescendantCoordRelativeToSelf(cellLayout, loc);
resetTransitionTransform(cellLayout);
- float dragViewScale = r.width() / d.dragView.getMeasuredWidth();
+ float dragViewScale = Math.min(r.width() / d.dragView.getMeasuredWidth(),
+ r.height() / d.dragView.getMeasuredHeight());
// The animation will scale the dragView about its center, so we need to center about
// the final location.
loc[0] -= (d.dragView.getMeasuredWidth() - cellLayoutScale * r.width()) / 2;