Pārlūkot izejas kodu

Correct scan area size on ios

flutter-beta
Tihomirov pirms 4 gadiem
vecāks
revīzija
b2ba000daf
1 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. +3
    -3
      ios/Classes/QRView.swift

+ 3
- 3
ios/Classes/QRView.swift Parādīt failu

@@ -84,7 +84,7 @@ public class QRView:NSObject,FlutterPlatformView {
return previewView
}
func setDimensions(_ result: @escaping FlutterResult, width: Double, height: Double, scanArea: Double, scanAreaOffset: Double) {
func setDimensions(_ result: @escaping FlutterResult, width: Double, height: Double, scanAreaWidth: Double, scanAreaHeight: Double, scanAreaOffset: Double) {
// Then set the size of the preview area.
previewView.frame = CGRect(x: 0, y: 0, width: width, height: height)
@@ -103,9 +103,9 @@ public class QRView:NSObject,FlutterPlatformView {
}

// Set scanArea if provided.
if (scanArea != 0) {
if (scanAreaWidth != 0 && scanAreaHeight != 0) {
scanner?.didStartScanningBlock = {
self.scanner?.scanRect = CGRect(x: Double(midX) - (scanArea / 2), y: Double(midY) - (scanArea / 2), width: scanArea, height: scanArea)
self.scanner?.scanRect = CGRect(x: Double(midX) - (scanAreaWidth / 2), y: Double(midY) - (scanAreaHeight / 2), width: scanAreaWidth, height: scanAreaHeight)

// Set offset if provided.
if (scanAreaOffset != 0) {


Notiek ielāde…
Atcelt
Saglabāt