Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
casvanluijtelaar
2022-06-07 16:09:06 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
31f6d12aecf72da5cfacede41807ca42394aaef5
31f6d12a
1 parent
86429442
attempt to fix rect calculation
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
ios/Classes/SwiftMobileScannerPlugin.swift
ios/Classes/SwiftMobileScannerPlugin.swift
View file @
31f6d12
...
...
@@ -250,12 +250,16 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHan
let
captureMetadataOutput
=
AVCaptureMetadataOutput
()
let
x
=
scanWindowData
!
[
0
]
/
CGFloat
(
demensions
.
width
)
let
y
=
scanWindowData
!
[
1
]
/
CGFloat
(
demensions
.
height
)
let
w
=
scanWindowData
!
[
2
]
-
scanWindowData
!
[
0
]
/
CGFloat
(
demensions
.
width
)
let
h
=
scanWindowData
!
[
3
]
-
scanWindowData
!
[
1
]
/
CGFloat
(
demensions
.
height
)
let
minX
=
scanWindowData
!
[
0
]
/
CGFloat
(
demensions
.
width
)
let
minY
=
scanWindowData
!
[
1
]
/
CGFloat
(
demensions
.
height
)
captureMetadataOutput
.
rectOfInterest
=
CGRect
(
x
:
x
,
y
:
y
,
width
:
w
,
height
:
h
)
let
maxX
=
scanWindowData
!
[
2
]
/
CGFloat
(
demensions
.
width
)
let
maxY
=
scanWindowData
!
[
3
]
/
CGFloat
(
demensions
.
height
)
let
width
=
maxX
-
minX
let
height
=
maxY
-
minY
captureMetadataOutput
.
rectOfInterest
=
CGRect
(
x
:
minX
,
y
:
minY
,
width
:
width
,
height
:
height
)
captureSession
.
addOutput
(
captureMetadataOutput
)
}
...
...
Please
register
or
login
to post a comment