From 0eed22d7497bb86923b5fe71e28e4854e337a603 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 20 Mar 2017 19:13:32 +0100 Subject: [PATCH] minor update --- .../simplemobiletools/camera/extensions/int.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/extensions/int.kt b/app/src/main/kotlin/com/simplemobiletools/camera/extensions/int.kt index cdb4dd18..12bcf39b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/extensions/int.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/extensions/int.kt @@ -1,15 +1,15 @@ package com.simplemobiletools.camera.extensions import android.hardware.Camera -import com.simplemobiletools.camera.Constants +import com.simplemobiletools.camera.ORIENT_LANDSCAPE_LEFT +import com.simplemobiletools.camera.ORIENT_LANDSCAPE_RIGHT fun Int.compensateDeviceRotation(currCameraId: Int): Int { - var degrees = 0 val isFrontCamera = currCameraId == Camera.CameraInfo.CAMERA_FACING_FRONT - if (this == Constants.ORIENT_LANDSCAPE_LEFT) { - degrees += if (isFrontCamera) 90 else 270 - } else if (this == Constants.ORIENT_LANDSCAPE_RIGHT) { - degrees += if (isFrontCamera) 270 else 90 - } - return degrees + return if (this == ORIENT_LANDSCAPE_LEFT) { + if (isFrontCamera) 90 else 270 + } else if (this == ORIENT_LANDSCAPE_RIGHT) { + if (isFrontCamera) 270 else 90 + } else + 0 }