diff options
author | Owen Lin <owenlin@google.com> | 2010-01-26 14:16:18 -0800 |
---|---|---|
committer | Owen Lin <owenlin@google.com> | 2010-01-26 14:16:18 -0800 |
commit | 8b1c724f385ae1973af382c500f58042f5b37466 (patch) | |
tree | f46d5535421ea2b2eec511fbee8c2873ac7c3ffb /src | |
parent | 52064aa4bacfae605823b99f675649b1786e8c8a (diff) | |
download | LegacyCamera-8b1c724f385ae1973af382c500f58042f5b37466.zip LegacyCamera-8b1c724f385ae1973af382c500f58042f5b37466.tar.gz LegacyCamera-8b1c724f385ae1973af382c500f58042f5b37466.tar.bz2 |
Fix a bug that RotateImage didn't draw the thumbnail in the center.
Change-Id: Ia46c5ecbceebd5062c76b9396f39a17ae6bc1ed2
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/RotateImageView.java | 1 | ||||
-rw-r--r-- | src/com/android/camera/ThumbnailController.java | 11 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/com/android/camera/RotateImageView.java b/src/com/android/camera/RotateImageView.java index 74152d4..14d1628 100644 --- a/src/com/android/camera/RotateImageView.java +++ b/src/com/android/camera/RotateImageView.java @@ -97,6 +97,7 @@ public class RotateImageView extends ImageView { } int saveCount = canvas.getSaveCount(); + canvas.translate(getPaddingLeft(), getPaddingTop()); canvas.rotate(-mCurrentDegree, w / 2, h / 2); drawable.draw(canvas); canvas.restoreToCount(saveCount); diff --git a/src/com/android/camera/ThumbnailController.java b/src/com/android/camera/ThumbnailController.java index 3bc0e8c..cd76276 100644 --- a/src/com/android/camera/ThumbnailController.java +++ b/src/com/android/camera/ThumbnailController.java @@ -152,14 +152,11 @@ public class ThumbnailController { return; } - // Make the mini-thumb size smaller than the button size so that the - // image corners don't peek out from the rounded corners of the - // frame_thumb graphic: - final int PADDING_WIDTH = 2; - final int PADDING_HEIGHT = 2; LayoutParams param = mButton.getLayoutParams(); - final int miniThumbWidth = param.width - 2 * PADDING_WIDTH; - final int miniThumbHeight = param.height - 2 * PADDING_HEIGHT; + final int miniThumbWidth = param.width + - mButton.getPaddingLeft() - mButton.getPaddingRight(); + final int miniThumbHeight = param.height + - mButton.getPaddingTop() - mButton.getPaddingBottom(); mThumb = ThumbnailUtil.extractMiniThumb( original, miniThumbWidth, miniThumbHeight, ThumbnailUtil.NO_RECYCLE_INPUT); |