react-native-rectangle-doc-scanner 7.28.0 → 7.29.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.
|
@@ -246,8 +246,9 @@ class CameraController(
|
|
|
246
246
|
val previewSizes = streamConfigMap.getOutputSizes(SurfaceTexture::class.java)
|
|
247
247
|
Log.d(TAG, "[CAMERA2] Available preview sizes: ${previewSizes?.take(10)?.joinToString { "${it.width}x${it.height}" }}")
|
|
248
248
|
|
|
249
|
-
//
|
|
250
|
-
val
|
|
249
|
+
// Prefer 4:3 to match iOS FOV on phones; use view aspect on tablets to reduce crop.
|
|
250
|
+
val isTablet = context.resources.configuration.smallestScreenWidthDp >= 600
|
|
251
|
+
val targetPreviewAspect = if (isTablet) viewAspect else 4.0 / 3.0
|
|
251
252
|
previewSize = chooseBestSize(previewSizes, targetPreviewAspect, null, preferClosestAspect = true)
|
|
252
253
|
?: chooseBestSize(previewSizes, viewAspect, null, preferClosestAspect = true)
|
|
253
254
|
?: previewSizes?.maxByOrNull { it.width * it.height }
|