@capgo/camera-preview 7.3.2 → 7.3.4

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.
@@ -1,6 +1,6 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-all.zip
4
4
  networkTimeout=10000
5
5
  validateDistributionUrl=true
6
6
  zipStoreBase=GRADLE_USER_HOME
@@ -69,18 +69,24 @@ public class CameraPreview: CAPPlugin, CAPBridgedPlugin {
69
69
  var disableAudio: Bool = false
70
70
 
71
71
  @objc func rotated() {
72
- let height = self.paddingBottom != nil ? self.height! - self.paddingBottom!: self.height!
72
+ guard let previewView = self.previewView,
73
+ let posX = self.posX,
74
+ let posY = self.posY,
75
+ let width = self.width,
76
+ let heightValue = self.height else {
77
+ return
78
+ }
79
+ let paddingBottom = self.paddingBottom ?? 0
80
+ let height = heightValue - paddingBottom
73
81
 
74
82
  if UIWindow.isLandscape {
75
- self.previewView.frame = CGRect(x: self.posY!, y: self.posX!, width: max(height, self.width!), height: min(height, self.width!))
76
- self.cameraController.previewLayer?.frame = self.previewView.frame
83
+ previewView.frame = CGRect(x: posY, y: posX, width: max(height, width), height: min(height, width))
84
+ self.cameraController.previewLayer?.frame = previewView.frame
77
85
  }
78
86
 
79
87
  if UIWindow.isPortrait {
80
- if self.previewView != nil && self.posX != nil && self.posY != nil && self.width != nil && self.height != nil {
81
- self.previewView.frame = CGRect(x: self.posX!, y: self.posY!, width: min(height, self.width!), height: max(height, self.width!))
82
- }
83
- self.cameraController.previewLayer?.frame = self.previewView.frame
88
+ previewView.frame = CGRect(x: posX, y: posY, width: min(height, width), height: max(height, width))
89
+ self.cameraController.previewLayer?.frame = previewView.frame
84
90
  }
85
91
 
86
92
  if let connection = self.cameraController.fileVideoOutput?.connection(with: .video) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/camera-preview",
3
- "version": "7.3.2",
3
+ "version": "7.3.4",
4
4
  "description": "Camera preview",
5
5
  "license": "MIT",
6
6
  "repository": {