react-native-rectangle-doc-scanner 3.196.0 → 3.197.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.
@@ -357,10 +357,10 @@ class CameraController(
357
357
  return
358
358
  }
359
359
 
360
- val rotation = previewView.display?.rotation ?: Surface.ROTATION_0
360
+ val rotationDegrees = getRotationDegrees()
361
361
  val matrix = Matrix()
362
362
  val viewRect = RectF(0f, 0f, viewWidth.toFloat(), viewHeight.toFloat())
363
- val bufferRect = if (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270) {
363
+ val bufferRect = if (rotationDegrees == 90 || rotationDegrees == 270) {
364
364
  RectF(0f, 0f, previewSize.height.toFloat(), previewSize.width.toFloat())
365
365
  } else {
366
366
  RectF(0f, 0f, previewSize.width.toFloat(), previewSize.height.toFloat())
@@ -371,17 +371,17 @@ class CameraController(
371
371
  bufferRect.offset(centerX - bufferRect.centerX(), centerY - bufferRect.centerY())
372
372
  matrix.setRectToRect(viewRect, bufferRect, Matrix.ScaleToFit.FILL)
373
373
 
374
- val scale = if (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270) {
374
+ val scale = if (rotationDegrees == 90 || rotationDegrees == 270) {
375
375
  maxOf(viewHeight.toFloat() / previewSize.height, viewWidth.toFloat() / previewSize.width)
376
376
  } else {
377
377
  maxOf(viewWidth.toFloat() / previewSize.width, viewHeight.toFloat() / previewSize.height)
378
378
  }
379
379
  matrix.postScale(scale, scale, centerX, centerY)
380
380
 
381
- when (rotation) {
382
- Surface.ROTATION_90 -> matrix.postRotate(90f, centerX, centerY)
383
- Surface.ROTATION_180 -> matrix.postRotate(180f, centerX, centerY)
384
- Surface.ROTATION_270 -> matrix.postRotate(270f, centerX, centerY)
381
+ when (rotationDegrees) {
382
+ 90 -> matrix.postRotate(90f, centerX, centerY)
383
+ 180 -> matrix.postRotate(180f, centerX, centerY)
384
+ 270 -> matrix.postRotate(270f, centerX, centerY)
385
385
  }
386
386
 
387
387
  previewView.setTransform(matrix)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "3.196.0",
3
+ "version": "3.197.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",