capacitor-plugin-camera-forked 2.0.8 → 2.0.10

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.
@@ -101,8 +101,8 @@ public class CameraPreviewPlugin extends Plugin {
101
101
  private PluginCall stopRecordingCall;
102
102
  private PluginCall takeSnapshotCall;
103
103
  private PluginCall saveFrameCall;
104
- private int desiredWidth = 1280;
105
- private int desiredHeight = 720;
104
+ private int desiredWidth = 1920;
105
+ private int desiredHeight = 1080;
106
106
  private CameraState previousCameraStatus;
107
107
  private ScanRegion scanRegion;
108
108
 
@@ -114,6 +114,7 @@ public class CameraPreviewPlugin extends Plugin {
114
114
  @RequiresApi(api = Build.VERSION_CODES.P)
115
115
  public void run() {
116
116
  previewView = new PreviewView(getContext());
117
+ previewView.setScaleType(PreviewView.ScaleType.FIT_CENTER);
117
118
  FrameLayout.LayoutParams cameraPreviewParams = new FrameLayout.LayoutParams(
118
119
  FrameLayout.LayoutParams.MATCH_PARENT,
119
120
  FrameLayout.LayoutParams.MATCH_PARENT
@@ -115,7 +115,7 @@ public class CameraPreviewPlugin: CAPPlugin, AVCaptureVideoDataOutputSampleBuffe
115
115
  let previewHeight = screenWidth * aspectRatio // Calculate height
116
116
 
117
117
  let screenHeight = previewView.bounds.height
118
- let previewY = (screenHeight - previewHeight) * 0.4 // Center vertically
118
+ let previewY = (screenHeight - previewHeight) * 0.5 // Center vertically
119
119
 
120
120
  self.previewView.frame = CGRect(x: 0, y: previewY, width: screenWidth, height: previewHeight)
121
121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-plugin-camera-forked",
3
- "version": "2.0.8",
3
+ "version": "2.0.10",
4
4
  "description": "A capacitor camera plugin - A custom Capacitor camera plugin with additional features.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",