diff options
author | Wu-cheng Li <wuchengli@google.com> | 2010-10-18 16:41:31 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-18 16:41:31 -0700 |
commit | c4a762222cf20beee749a448be2bdf4765d06e54 (patch) | |
tree | ecd5b8e3fc11d0d4441a6614144be2fe7afb20f5 | |
parent | 8974ca6b9412446d05f580c8d694d7e61eacb5ce (diff) | |
parent | 03f097a09297ac400d340b3c4ffff4a9312da4f0 (diff) | |
download | LegacyCamera-c4a762222cf20beee749a448be2bdf4765d06e54.zip LegacyCamera-c4a762222cf20beee749a448be2bdf4765d06e54.tar.gz LegacyCamera-c4a762222cf20beee749a448be2bdf4765d06e54.tar.bz2 |
am 03f097a0: am a7c1c50e: Merge "Fix wrong aspect ratio of camera preview." into gingerbread
Merge commit '03f097a09297ac400d340b3c4ffff4a9312da4f0'
* commit '03f097a09297ac400d340b3c4ffff4a9312da4f0':
Fix wrong aspect ratio of camera preview.
-rw-r--r-- | src/com/android/camera/PreviewFrameLayout.java | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/com/android/camera/PreviewFrameLayout.java b/src/com/android/camera/PreviewFrameLayout.java index d65cc22..1ec629f 100644 --- a/src/com/android/camera/PreviewFrameLayout.java +++ b/src/com/android/camera/PreviewFrameLayout.java @@ -70,24 +70,13 @@ public class PreviewFrameLayout extends ViewGroup { @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { - // Try to layout the "frame" in the center of the area, and put - // "gripper" just to the left of it. If there is no enough space for - // the gripper, the "frame" will be moved a little right so that - // they won't overlap with each other. - int frameWidth = getWidth(); int frameHeight = getHeight(); FrameLayout f = mFrame; - - int horizontalPadding = Math.max( - f.getPaddingLeft() + f.getPaddingRight(), - (int) (MIN_HORIZONTAL_MARGIN * mMetrics.density)); + int horizontalPadding = f.getPaddingLeft() + f.getPaddingRight(); int verticalPadding = f.getPaddingBottom() + f.getPaddingTop(); - - // Ignore the vertical paddings, so that we won't draw the frame on the - // top and bottom sides - int previewHeight = frameHeight; + int previewHeight = frameHeight - verticalPadding; int previewWidth = frameWidth - horizontalPadding; // resize frame and preview for aspect ratio |