if force 16:9 ratio is not forced, try taking 4:3

This commit is contained in:
tibbi 2016-09-20 20:21:50 +02:00
parent 139013bf2d
commit 1c113e5472
2 changed files with 3 additions and 2 deletions

View File

@ -324,7 +324,7 @@ public class Preview extends ViewGroup
Collections.sort(sizes, new SizesComparator());
Camera.Size maxSize = sizes.get(0);
for (Camera.Size size : sizes) {
final boolean isProperRatio = !mForceAspectRatio || isProperRatio(size);
final boolean isProperRatio = isProperRatio(size);
final boolean isProperResolution = isProperResolution(size, maxResolution);
if (isProperResolution && isProperRatio) {
maxSize = size;
@ -369,6 +369,7 @@ public class Preview extends ViewGroup
float wantedRatio = (float) 3 / 4;
if (mForceAspectRatio || mIsVideoMode)
wantedRatio = (float) 9 / 16;
final float diff = Math.abs(currRatio - wantedRatio);
return diff < RATIO_TOLERANCE;
}

View File

@ -20,7 +20,7 @@
<string name="dark_theme">Dark theme</string>
<string name="use_dcim_folder">Store media in the default DCIM folder</string>
<string name="focus_before_capture">Refocus before capture</string>
<string name="force_ratio">Force 16:9 ratio</string>
<string name="force_ratio">Use 16:9 ratio</string>
<string name="max_photo_size">Photo resolution limit</string>
<string name="max_video_size">Video resolution limit</string>
<string name="no_limit">none</string>