OSDN Git Service

Fixing small bug in widget resizing
authorAdam Cohen <adamcohen@google.com>
Tue, 3 May 2011 21:20:38 +0000 (14:20 -0700)
committerAdam Cohen <adamcohen@google.com>
Tue, 3 May 2011 21:20:38 +0000 (14:20 -0700)
Change-Id: I7bba5d09aa92437c81e1730758710c1132e26dde

src/com/android/launcher2/AppWidgetResizeFrame.java

index d975ed9..4390c59 100644 (file)
@@ -291,8 +291,8 @@ public class AppWidgetResizeFrame extends FrameLayout {
 
     public void snapToWidget(boolean animate) {
         final DragLayer.LayoutParams lp = (DragLayer.LayoutParams) getLayoutParams();
-        int xOffset = mCellLayout.getLeft() - mWorkspace.getScrollX();
-        int yOffset = mCellLayout.getTop() - mWorkspace.getScrollY();
+        int xOffset = mCellLayout.getLeft() + mCellLayout.getLeftPadding() - mWorkspace.getScrollX();
+        int yOffset = mCellLayout.getTop() + mCellLayout.getTopPadding() - mWorkspace.getScrollY();
 
         int newWidth = mWidgetView.getWidth() + 2 * mBackgroundPadding;
         int newHeight = mWidgetView.getHeight() + 2 * mBackgroundPadding;