From 77cdba5447116f40c687135da15d404dc4382fe7 Mon Sep 17 00:00:00 2001 From: Haik Aslanyan Date: Sun, 12 Apr 2020 21:30:39 +0400 Subject: [PATCH] fixed padding calculation --- Sources/Public/RCCameraViewController.swift | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Sources/Public/RCCameraViewController.swift b/Sources/Public/RCCameraViewController.swift index 8b3242c..754d022 100644 --- a/Sources/Public/RCCameraViewController.swift +++ b/Sources/Public/RCCameraViewController.swift @@ -170,11 +170,9 @@ extension RCCameraViewController { } private func calculateScanArea() { -// let actualWidth = view.frame.height / 16 * 9 -// var sideArea: CGFloat = min(view.bounds.width, view.bounds.height) * 0.9 * 0.2 -// sideArea += (actualWidth - min(view.bounds.width, view.bounds.height) * 0.9) / 2 -// let area = sideArea / min(view.bounds.width, view.bounds.height) * 720 -// coder.set(scanArea: Int(area)) + let actualWidth = view.frame.height / 16 * 9 + let sideArea = (actualWidth - view.frame.width * 0.9) / 2 + coder.imageDecoder.padding = Int(sideArea / actualWidth * 720) } private func configureVideoPreview(orientation: AVCaptureVideoOrientation = .portrait) {