mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Fixing issue with click shadow not being drawn correctly.
- It was due to the view parent (prediction bar) which has its own translation.
This commit is contained in:
@@ -96,12 +96,14 @@ public class ClickShadowView extends View {
|
||||
float drawableWidth = view.getIcon().getBounds().width();
|
||||
|
||||
setTranslationX(leftShift
|
||||
+ viewParent.getTranslationX()
|
||||
+ view.getCompoundPaddingLeft() * view.getScaleX()
|
||||
+ (iconHSpace - drawableWidth) * view.getScaleX() / 2 /* drawable gap */
|
||||
+ iconWidth * (1 - view.getScaleX()) / 2 /* gap due to scale */
|
||||
- mShadowPadding /* extra shadow size */
|
||||
);
|
||||
setTranslationY(topShift
|
||||
+ viewParent.getTranslationY()
|
||||
+ view.getPaddingTop() * view.getScaleY() /* drawable gap */
|
||||
+ view.getHeight() * (1 - view.getScaleY()) / 2 /* gap due to scale */
|
||||
- mShadowPadding /* extra shadow size */
|
||||
|
||||
Reference in New Issue
Block a user