From dd91ed9acb9ebafa37d796a71834267065554c70 Mon Sep 17 00:00:00 2001 From: Dominik Spicher Date: Tue, 1 Oct 2019 14:00:13 +0200 Subject: [PATCH] Draw overlay based on rect position --- lib/src/qr_scanner_overlay_shape.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/qr_scanner_overlay_shape.dart b/lib/src/qr_scanner_overlay_shape.dart index db42605..67c8439 100644 --- a/lib/src/qr_scanner_overlay_shape.dart +++ b/lib/src/qr_scanner_overlay_shape.dart @@ -87,8 +87,8 @@ class QrScannerOverlayShape extends ShapeBorder { ..blendMode = BlendMode.dstOut; final cutOutRect = Rect.fromLTWH( - width / 2 - _cutOutSize / 2 + borderOffset, - height / 2 - _cutOutSize / 2 + borderOffset, + rect.left + width / 2 - _cutOutSize / 2 + borderOffset, + rect.top + height / 2 - _cutOutSize / 2 + borderOffset, _cutOutSize - borderOffset * 2, _cutOutSize - borderOffset * 2, );