react-native-rectangle-doc-scanner 4.14.0 → 4.15.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.
@@ -548,18 +548,12 @@ class CameraController(
548
548
  }
549
549
  previewView.setTransform(matrix)
550
550
 
551
- // Center-crop to fill the view.
552
- val viewAspect = viewWidth / viewHeight
553
- val bufferAspect = bufferWidth / bufferHeight
551
+ // Uniform center-crop to fill the view.
552
+ val scale = max(viewWidth / bufferWidth, viewHeight / bufferHeight)
554
553
  previewView.pivotX = centerX
555
554
  previewView.pivotY = centerY
556
- if (bufferAspect > viewAspect) {
557
- previewView.scaleX = bufferAspect / viewAspect
558
- previewView.scaleY = 1f
559
- } else {
560
- previewView.scaleX = 1f
561
- previewView.scaleY = viewAspect / bufferAspect
562
- }
555
+ previewView.scaleX = scale
556
+ previewView.scaleY = scale
563
557
  }
564
558
 
565
559
  private fun chooseBestSize(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "4.14.0",
3
+ "version": "4.15.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",