react-native-rectangle-doc-scanner 10.14.0 → 10.15.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.
|
@@ -475,16 +475,15 @@ class CameraController(
|
|
|
475
475
|
val centerY = viewHeight / 2f
|
|
476
476
|
|
|
477
477
|
// Calculate rotation needed for portrait display
|
|
478
|
-
//
|
|
479
|
-
// Sensor 0° =
|
|
480
|
-
// Sensor 90° =
|
|
481
|
-
// Sensor 270° = need 270° correction
|
|
478
|
+
// For back camera in portrait mode, we need to rotate counter-clockwise
|
|
479
|
+
// Sensor 0° = landscape sensor, need 270° (-90°) rotation
|
|
480
|
+
// Sensor 90° = portrait sensor, need 270° (-90°) rotation to correct
|
|
482
481
|
val rotationDegrees = when (sensorOrientation) {
|
|
483
|
-
0 -> 270f // Tablet
|
|
484
|
-
90 ->
|
|
485
|
-
180 ->
|
|
486
|
-
270 ->
|
|
487
|
-
else ->
|
|
482
|
+
0 -> 270f // Tablet - landscape sensor
|
|
483
|
+
90 -> 270f // Phone - portrait sensor but still needs 270° rotation
|
|
484
|
+
180 -> 90f // Inverted
|
|
485
|
+
270 -> 90f // Some rare devices
|
|
486
|
+
else -> 270f
|
|
488
487
|
}
|
|
489
488
|
|
|
490
489
|
Log.d(TAG, "[TRANSFORM] Applying rotation: ${rotationDegrees}°")
|
package/package.json
CHANGED