Skip to content

Commit

Permalink
Merge pull request #1230 from IanVS/overlay-example
Browse files Browse the repository at this point in the history
fix: scanner overlay example
  • Loading branch information
navaronbracke authored Nov 2, 2024
2 parents e01fbed + 29dbcc3 commit 8e983f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions example/lib/barcode_scanner_window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ class ScannerOverlay extends CustomPainter {

@override
void paint(Canvas canvas, Size size) {
// TODO: use `Offset.zero & size` instead of Rect.largest
// we need to pass the size to the custom paint widget
final backgroundPath = Path()..addRect(Rect.largest);
final backgroundPath = Path()
..addRect(Rect.fromLTWH(0, 0, size.width, size.height));
final cutoutPath = Path()..addRect(scanWindow);

final backgroundPaint = Paint()
..color = Colors.black.withOpacity(0.5)
..style = PaintingStyle.fill
..blendMode = BlendMode.dstOut;
..blendMode = BlendMode.dstOver;

final backgroundWithCutout = Path.combine(
PathOperation.difference,
Expand Down
6 changes: 3 additions & 3 deletions example/lib/mobile_scanner_overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ class ScannerOverlay extends CustomPainter {

@override
void paint(Canvas canvas, Size size) {
// TODO: use `Offset.zero & size` instead of Rect.largest
// we need to pass the size to the custom paint widget
final backgroundPath = Path()..addRect(Rect.largest);
final backgroundPath = Path()
..addRect(Rect.fromLTWH(0, 0, size.width, size.height));

final cutoutPath = Path()
..addRRect(
Expand All @@ -120,7 +120,7 @@ class ScannerOverlay extends CustomPainter {
final backgroundPaint = Paint()
..color = Colors.black.withOpacity(0.5)
..style = PaintingStyle.fill
..blendMode = BlendMode.dstOut;
..blendMode = BlendMode.dstOver;

final backgroundWithCutout = Path.combine(
PathOperation.difference,
Expand Down

0 comments on commit 8e983f1

Please sign in to comment.