diff options
author | Tony Wickham <twickham@google.com> | 2017-06-16 19:35:57 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-06-16 19:35:58 +0000 |
commit | f4087bbab4c508332ea9f722c511aaabf6550a11 (patch) | |
tree | 302fe89d6d9d394d60a90ae23bfe796b6d4eca41 /src/com/android/launcher3/popup | |
parent | b37200637d4ee83679be1cd23c3e5ae809fde78b (diff) | |
parent | ad69fa4c7447879697587c2ed537ac5edb1f82a4 (diff) | |
download | android_packages_apps_Trebuchet-f4087bbab4c508332ea9f722c511aaabf6550a11.tar.gz android_packages_apps_Trebuchet-f4087bbab4c508332ea9f722c511aaabf6550a11.tar.bz2 android_packages_apps_Trebuchet-f4087bbab4c508332ea9f722c511aaabf6550a11.zip |
Merge "Round popup corner clipping rotation center" into ub-launcher3-dorval-polish
Diffstat (limited to 'src/com/android/launcher3/popup')
-rw-r--r-- | src/com/android/launcher3/popup/PopupItemView.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher3/popup/PopupItemView.java b/src/com/android/launcher3/popup/PopupItemView.java index 05cadb671..8ec051b30 100644 --- a/src/com/android/launcher3/popup/PopupItemView.java +++ b/src/com/android/launcher3/popup/PopupItemView.java @@ -100,22 +100,24 @@ public abstract class PopupItemView extends FrameLayout { // Clip children to this item's rounded corners. int cornerWidth = mRoundedCornerBitmap.getWidth(); int cornerHeight = mRoundedCornerBitmap.getHeight(); + int cornerCenterX = Math.round(cornerWidth / 2f); + int cornerCenterY = Math.round(cornerHeight / 2f); if ((mRoundedCorners & ROUNDED_TOP_CORNERS) != 0) { // Clip top left corner. mMatrix.reset(); canvas.drawBitmap(mRoundedCornerBitmap, mMatrix, mBackgroundClipPaint); // Clip top right corner. - mMatrix.setRotate(90, cornerWidth / 2, cornerHeight / 2); + mMatrix.setRotate(90, cornerCenterX, cornerCenterY); mMatrix.postTranslate(canvas.getWidth() - cornerWidth, 0); canvas.drawBitmap(mRoundedCornerBitmap, mMatrix, mBackgroundClipPaint); } if ((mRoundedCorners & ROUNDED_BOTTOM_CORNERS) != 0) { // Clip bottom right corner. - mMatrix.setRotate(180, cornerWidth / 2, cornerHeight / 2); + mMatrix.setRotate(180, cornerCenterX, cornerCenterY); mMatrix.postTranslate(canvas.getWidth() - cornerWidth, canvas.getHeight() - cornerHeight); canvas.drawBitmap(mRoundedCornerBitmap, mMatrix, mBackgroundClipPaint); // Clip bottom left corner. - mMatrix.setRotate(270, cornerWidth / 2, cornerHeight / 2); + mMatrix.setRotate(270, cornerCenterX, cornerCenterY); mMatrix.postTranslate(0, canvas.getHeight() - cornerHeight); canvas.drawBitmap(mRoundedCornerBitmap, mMatrix, mBackgroundClipPaint); } |