Merge "Fix wrong aspect ratio of camera preview." into gingerbread
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 @@
 
     @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