diff options
Diffstat (limited to 'src/com/android/launcher2/DragView.java')
-rw-r--r-- | src/com/android/launcher2/DragView.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/com/android/launcher2/DragView.java b/src/com/android/launcher2/DragView.java index 41e76f0e1..d14f5f756 100644 --- a/src/com/android/launcher2/DragView.java +++ b/src/com/android/launcher2/DragView.java @@ -76,8 +76,7 @@ public class DragView extends View implements TweenCallback { scale.setScale(scaleFactor, scaleFactor); mBitmap = Bitmap.createBitmap(bitmap, left, top, width, height, scale, true); - mDragRegionWidth = width; - mDragRegionHeight = height; + setDragRegion(0, 0, width, height); // The point in our scaled bitmap that the touch events are located mRegistrationX = registrationX + (DRAG_SCALE / 2); @@ -91,6 +90,22 @@ public class DragView extends View implements TweenCallback { mDragRegionHeight = height; } + public int getScaledDragRegionXOffset() { + return -(int)((mScale - 1.0f) * mDragRegionWidth / 2); + } + + public int getScaledDragRegionWidth() { + return (int)(mScale * mDragRegionWidth); + } + + public int getScaledDragRegionYOffset() { + return -(int)((mScale - 1.0f) * mDragRegionHeight / 2); + } + + public int getScaledDragRegionHeight() { + return (int)(mScale * mDragRegionWidth); + } + public int getDragRegionLeft() { return mDragRegionLeft; } |