mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Use the icon bounds for all calculations.
- Fixes a drag and drop issue when the dynamic grid scales icons down, due to the drawable bounds not being equal to their bitmap sizes. Change-Id: If7c68b51131de7bac3195a2619e22340f7789432
This commit is contained in:
@@ -51,6 +51,9 @@ public class DragView extends View {
|
||||
private float mOffsetX = 0.0f;
|
||||
private float mOffsetY = 0.0f;
|
||||
private float mInitialScale = 1f;
|
||||
// The intrinsic icon scale factor is the scale factor for a drag icon over the workspace
|
||||
// size. This is ignored for non-icons.
|
||||
private float mIntrinsicIconScale = 1f;
|
||||
|
||||
/**
|
||||
* Construct the drag view.
|
||||
@@ -120,6 +123,15 @@ public class DragView extends View {
|
||||
mPaint = new Paint(Paint.FILTER_BITMAP_FLAG);
|
||||
}
|
||||
|
||||
/** Sets the scale of the view over the normal workspace icon size. */
|
||||
public void setIntrinsicIconScaleFactor(float scale) {
|
||||
mIntrinsicIconScale = scale;
|
||||
}
|
||||
|
||||
public float getIntrinsicIconScaleFactor() {
|
||||
return mIntrinsicIconScale;
|
||||
}
|
||||
|
||||
public float getOffsetY() {
|
||||
return mOffsetY;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user