react-native-rectangle-doc-scanner 7.3.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -510,25 +510,17 @@ class CameraController(
|
|
|
510
510
|
|
|
511
511
|
private fun computeRotationDegrees(): Int {
|
|
512
512
|
val displayRotation = displayRotationDegrees()
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
displayRotation
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
if (sensorOrientation == 180) {
|
|
521
|
-
return if (useFrontCamera) {
|
|
522
|
-
(180 + displayRotation) % 360
|
|
523
|
-
} else {
|
|
524
|
-
(180 - displayRotation + 360) % 360
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
return if (useFrontCamera) {
|
|
513
|
+
|
|
514
|
+
// For back camera with sensor orientation 0 and display rotation 90 (portrait),
|
|
515
|
+
// we need 270 degree rotation to display correctly
|
|
516
|
+
val rotation = if (useFrontCamera) {
|
|
528
517
|
(sensorOrientation + displayRotation) % 360
|
|
529
518
|
} else {
|
|
530
519
|
(sensorOrientation - displayRotation + 360) % 360
|
|
531
520
|
}
|
|
521
|
+
|
|
522
|
+
Log.d(TAG, "[ROTATION] sensor=$sensorOrientation display=$displayRotation front=$useFrontCamera -> rotation=$rotation")
|
|
523
|
+
return rotation
|
|
532
524
|
}
|
|
533
525
|
|
|
534
526
|
private fun displayRotationDegrees(): Int {
|