react-native-rectangle-doc-scanner 7.17.0 → 7.18.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.
|
@@ -565,14 +565,11 @@ class CameraController(
|
|
|
565
565
|
val isSwapped = rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270
|
|
566
566
|
val bufferWidth = if (isSwapped) preview.height.toFloat() else preview.width.toFloat()
|
|
567
567
|
val bufferHeight = if (isSwapped) preview.width.toFloat() else preview.height.toFloat()
|
|
568
|
-
val
|
|
569
|
-
val
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
matrix.setScale(scale, scale)
|
|
575
|
-
matrix.postTranslate(dx, dy)
|
|
568
|
+
val viewRect = RectF(0f, 0f, viewWidth, viewHeight)
|
|
569
|
+
val bufferRect = RectF(0f, 0f, bufferWidth, bufferHeight)
|
|
570
|
+
|
|
571
|
+
// Scale to fill while preserving aspect ratio; avoid double-scaling.
|
|
572
|
+
matrix.setRectToRect(bufferRect, viewRect, Matrix.ScaleToFit.FILL)
|
|
576
573
|
|
|
577
574
|
if (rotation != Surface.ROTATION_0) {
|
|
578
575
|
val rotateDegrees = when (rotation) {
|