diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2015-07-30 19:22:39 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-07-30 19:22:39 -0700 |
commit | 71c704a10909735e1323e767f04ab8be8dcca983 (patch) | |
tree | 298280616795dbd33aacaf983ab676ef8a338b58 | |
parent | 9f0ae4a87cec60a0fcd7176714431c935132f7c7 (diff) | |
parent | 6ad7a457b15d5f709a118fcd34ab85381bb65141 (diff) | |
download | android_packages_apps_Snap-71c704a10909735e1323e767f04ab8be8dcca983.tar.gz android_packages_apps_Snap-71c704a10909735e1323e767f04ab8be8dcca983.tar.bz2 android_packages_apps_Snap-71c704a10909735e1323e767f04ab8be8dcca983.zip |
Merge "SnapdragonCamera: fix thumbnail display"
-rw-r--r-- | src/com/android/camera/CameraActivity.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index ef3e48f72..63a38f0a4 100644 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -829,8 +829,6 @@ public class CameraActivity extends Activity int w = opt.outWidth; int h = opt.outHeight; int d = w > h ? h : w; - final Rect rect = w > h ? new Rect((w - h) / 2, 0, (w + h) / 2, h) - : new Rect(0, (h - w) / 2, w, (h + w) / 2); final int target = getResources().getDimensionPixelSize(R.dimen.capture_size); int sample = 1; @@ -839,6 +837,8 @@ public class CameraActivity extends Activity sample *= 2; } } + int st = sample * target; + final Rect rect = new Rect((w - st) / 2, (h - st) / 2, (w + st) / 2, (h + st) / 2); opt.inJustDecodeBounds = false; opt.inSampleSize = sample; @@ -892,6 +892,8 @@ public class CameraActivity extends Activity } else if (w < h) { mLength = w; bitmap = Bitmap.createBitmap(bitmap, 0, (h - w) / 2, w, w); + } else { + mLength = w; } mBitmapShader = new BitmapShader(bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); |