react-native-rectangle-doc-scanner 10.13.0 → 10.14.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.
|
@@ -474,15 +474,17 @@ class CameraController(
|
|
|
474
474
|
val centerX = viewWidth / 2f
|
|
475
475
|
val centerY = viewHeight / 2f
|
|
476
476
|
|
|
477
|
-
// Calculate rotation needed
|
|
478
|
-
//
|
|
479
|
-
// Sensor
|
|
477
|
+
// Calculate rotation needed for portrait display
|
|
478
|
+
// The rotation is inverse of sensor orientation
|
|
479
|
+
// Sensor 0° = device held naturally shows landscape, need 270° to portrait
|
|
480
|
+
// Sensor 90° = device held naturally shows portrait, need 90° correction
|
|
481
|
+
// Sensor 270° = need 270° correction
|
|
480
482
|
val rotationDegrees = when (sensorOrientation) {
|
|
481
|
-
0 ->
|
|
482
|
-
90 ->
|
|
483
|
+
0 -> 270f // Tablet case - sensor is landscape, rotate to portrait
|
|
484
|
+
90 -> 90f // Most phones - sensor already portrait-ish, small correction
|
|
483
485
|
180 -> 180f
|
|
484
|
-
270 ->
|
|
485
|
-
else ->
|
|
486
|
+
270 -> 270f
|
|
487
|
+
else -> 90f
|
|
486
488
|
}
|
|
487
489
|
|
|
488
490
|
Log.d(TAG, "[TRANSFORM] Applying rotation: ${rotationDegrees}°")
|
package/package.json
CHANGED