From 29dbcc3b5412f28aa9a89f29dd6547e363d79459 Mon Sep 17 00:00:00 2001 From: Ian VanSchooten Date: Fri, 1 Nov 2024 10:19:29 -0400 Subject: [PATCH] Fix scanner overlay examples --- example/lib/barcode_scanner_window.dart | 6 +++--- example/lib/mobile_scanner_overlay.dart | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/example/lib/barcode_scanner_window.dart b/example/lib/barcode_scanner_window.dart index 4691ac520..4a1a53d4d 100644 --- a/example/lib/barcode_scanner_window.dart +++ b/example/lib/barcode_scanner_window.dart @@ -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, diff --git a/example/lib/mobile_scanner_overlay.dart b/example/lib/mobile_scanner_overlay.dart index ae188cb35..b0ed660fd 100644 --- a/example/lib/mobile_scanner_overlay.dart +++ b/example/lib/mobile_scanner_overlay.dart @@ -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( @@ -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,