INNER CODE UNIT · Swift
scanRect
AmolGangadhare/flutter_barcode_scanner · ios/Classes/SwiftFlutterBarcodeScannerPlugin.swift:338
let scanRect = CGRect(x: xCor, y: yCor, width: self.isOrientationPortrait ? (screenSize.width*0.8) : (screenSize.height*0.8), height: screenHeight)
let rectOfInterest = videoPreviewLayer?.metadataOutputRectConverted(fromLayerRect: scanRect)
if let rOI = rectOfInterest{
captureMetadataOutput.rectOfInterest = rOI
}
// Initialize QR Code Frame to highlight the QR code
qrCodeFrameView = UIView()
qrCodeFrameView!.frame = CGRect(x: 0, y: 0, width: self.isOrientationPortrait ? (screenSize.width * 0.8) : (screenSize.height * 0.8), height: screenHeight)
if let qrCodeFrameView = qrCodeFrameView {
self.view.addSubview(qrCodeFrameView)
self.view.bringSubviewToFront(qrCodeFrameView)
qrCodeFrameView.layer.insertSublayer(fillLayer, below: videoPreviewLayer!)
self.view.bringSubviewToFront(bottomView)