react-native-rectangle-doc-scanner 10.47.0 → 10.48.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.
|
@@ -547,8 +547,16 @@ class CameraController(
|
|
|
547
547
|
|
|
548
548
|
// For sensor=0 (tablet landscape), we need to manually rotate the buffer
|
|
549
549
|
// CameraX only handles rotation automatically for sensor=90 (phone portrait)
|
|
550
|
+
// Important: For sensor=0, we need to rotate in the OPPOSITE direction
|
|
551
|
+
// When display is 90° (portrait), we need to rotate -90° (270°) to compensate
|
|
550
552
|
if (sensorOrientation == 0 && displayRotationDegrees != 0) {
|
|
551
|
-
|
|
553
|
+
val rotationDegrees = when (displayRotationDegrees) {
|
|
554
|
+
90 -> -90f // Display 90° → Rotate -90° (counter-clockwise)
|
|
555
|
+
180 -> -180f
|
|
556
|
+
270 -> -270f // Or +90f
|
|
557
|
+
else -> 0f
|
|
558
|
+
}
|
|
559
|
+
matrix.postRotate(rotationDegrees, centerX, centerY)
|
|
552
560
|
}
|
|
553
561
|
|
|
554
562
|
// Calculate rotated buffer dimensions
|
package/package.json
CHANGED