diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2015-07-30 22:19:49 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-07-30 22:19:49 +0000 |
commit | 176196c0acae9872cf2d32446e558bd381a9bafa (patch) | |
tree | f315e3444e76c8ecb43d2d9a4939eeafa248fdc9 /src | |
parent | fd69e0b527b7b6c0646072325fa232313e46bbc5 (diff) | |
parent | b9f932e08902c21020b6a98372c1a68548b8de59 (diff) | |
download | android_packages_apps_Trebuchet-176196c0acae9872cf2d32446e558bd381a9bafa.tar.gz android_packages_apps_Trebuchet-176196c0acae9872cf2d32446e558bd381a9bafa.tar.bz2 android_packages_apps_Trebuchet-176196c0acae9872cf2d32446e558bd381a9bafa.zip |
Merge "Prevent from widget cell preview image from being cut off." into ub-launcher3-burnaby
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/WidgetPreviewLoader.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/launcher3/WidgetPreviewLoader.java b/src/com/android/launcher3/WidgetPreviewLoader.java index 629387ed0..2a8053d52 100644 --- a/src/com/android/launcher3/WidgetPreviewLoader.java +++ b/src/com/android/launcher3/WidgetPreviewLoader.java @@ -386,7 +386,7 @@ public class WidgetPreviewLoader { preScaledWidthOut[0] = previewWidth; } if (previewWidth > maxPreviewWidth) { - scale = maxPreviewWidth / (float) previewWidth; + scale = (maxPreviewWidth - 2 * mProfileBadgeMargin) / (float) (previewWidth); } if (scale != 1f) { previewWidth = (int) (scale * previewWidth); @@ -405,7 +405,7 @@ public class WidgetPreviewLoader { } // Draw the scaled preview into the final bitmap - int x = (preview.getWidth() - previewWidth - mProfileBadgeMargin) / 2; + int x = (preview.getWidth() - previewWidth) / 2; if (widgetPreviewExists) { drawable.setBounds(x, 0, x + previewWidth, previewHeight); drawable.draw(c); |