From cf64374411cbf67e289de4f00abbf5c3d3184d9c Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 10 Jul 2018 11:27:15 +0200 Subject: [PATCH] removing a redundant variable --- .../kotlin/com/simplemobiletools/camera/helpers/Constants.kt | 1 - .../com/simplemobiletools/camera/views/PreviewCameraOne.kt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/camera/helpers/Constants.kt index 7d34c213..b16e441e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/helpers/Constants.kt @@ -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" diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraOne.kt b/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraOne.kt index 2b5499c7..a5bb68a6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraOne.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraOne.kt @@ -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 }