removing a redundant variable

This commit is contained in:
tibbi 2018-07-10 11:27:15 +02:00
parent 4f1bfc3e2a
commit cf64374411
2 changed files with 1 additions and 2 deletions

View File

@ -3,7 +3,6 @@ package com.simplemobiletools.camera.helpers
const val ORIENT_PORTRAIT = 0
const val ORIENT_LANDSCAPE_LEFT = 1
const val ORIENT_LANDSCAPE_RIGHT = 2
const val RATIO_TOLERANCE = 0.1f
// shared preferences
const val SAVE_PHOTOS = "save_photos"

View File

@ -257,7 +257,7 @@ class PreviewCameraOne : ViewGroup, SurfaceHolder.Callback, MyPreview {
val screenAspectRatio = mActivity!!.realScreenSize.y / mActivity!!.realScreenSize.x.toFloat()
resolutions.forEachIndexed { index, size ->
val diff = screenAspectRatio - (size.width / size.height.toFloat())
if (Math.abs(diff) < RATIO_TOLERANCE) {
if (Math.abs(diff) < 0.1f) {
mConfig.backPhotoResIndex = index
return index
}