minor update
This commit is contained in:
parent
207bb44eed
commit
0eed22d749
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue