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
- // Match iOS photo preset behavior (4:3) when available for consistent FOV.
250
- val targetPreviewAspect = 4.0 / 3.0
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 }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "7.28.0",
3
+ "version": "7.29.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",