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
Navaron Bracke
2023-11-09 11:50:48 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
18bcb68b2466ee638097e1445976430d6b78f8dd
18bcb68b
1 parent
1d68f6b2
let the barcode overlay take the camera preview size as argument
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
example/lib/barcode_scanner_window.dart
example/lib/barcode_scanner_window.dart
View file @
18bcb68
...
...
@@ -139,15 +139,15 @@ class ScannerOverlay extends CustomPainter {
class
BarcodeOverlay
extends
CustomPainter
{
BarcodeOverlay
({
required
this
.
barcode
,
required
this
.
arguments
,
required
this
.
boxFit
,
required
this
.
cameraPreviewSize
,
required
this
.
capture
,
});
final
BarcodeCapture
capture
;
final
Barcode
barcode
;
final
MobileScannerArguments
arguments
;
final
BoxFit
boxFit
;
final
Size
cameraPreviewSize
;
final
BarcodeCapture
capture
;
@override
void
paint
(
Canvas
canvas
,
Size
size
)
{
...
...
@@ -155,7 +155,7 @@ class BarcodeOverlay extends CustomPainter {
return
;
}
final
adjustedSize
=
applyBoxFit
(
boxFit
,
arguments
.
s
ize
,
size
);
final
adjustedSize
=
applyBoxFit
(
boxFit
,
cameraPreviewS
ize
,
size
);
double
verticalPadding
=
size
.
height
-
adjustedSize
.
destination
.
height
;
double
horizontalPadding
=
size
.
width
-
adjustedSize
.
destination
.
width
;
...
...
@@ -178,8 +178,8 @@ class BarcodeOverlay extends CustomPainter {
ratioWidth
=
capture
.
size
.
width
/
adjustedSize
.
destination
.
width
;
ratioHeight
=
capture
.
size
.
height
/
adjustedSize
.
destination
.
height
;
}
else
{
ratioWidth
=
arguments
.
size
.
width
/
adjustedSize
.
destination
.
width
;
ratioHeight
=
arguments
.
size
.
height
/
adjustedSize
.
destination
.
height
;
ratioWidth
=
cameraPreviewSize
.
width
/
adjustedSize
.
destination
.
width
;
ratioHeight
=
cameraPreviewSize
.
height
/
adjustedSize
.
destination
.
height
;
}
final
List
<
Offset
>
adjustedOffset
=
[];
...
...
Please
register
or
login
to post a comment