diff --git a/packages/qr-code-scanner/README.md b/packages/qr-code-scanner/README.md index f62262b95b724e8bfb38db300aa8c3698b11b66e..08a10232ad04e1b5415d499bf8b818fdbde77271 100644 --- a/packages/qr-code-scanner/README.md +++ b/packages/qr-code-scanner/README.md @@ -28,8 +28,6 @@ a box under the video canvas with the read QR code data - `stop-scan` (optional, default: `false`): set to `true` when you don't want to start the QR code reader immediatly after loaded. This attribute is also used to stop the QR code reader or if you don't need it anymore. - example `<dbp-qr-code-scanner stop-scan></dbp-qr-code-scanner>` -- `clip-mask` (optional, default: `true`): set to `false` when you don't want to use a QR code reader with a mask for better perfomance - - example `<dbp-qr-code-scanner clip-mask></dbp-qr-code-scanner>` ## Events diff --git a/packages/qr-code-scanner/src/qr-code-scanner.js b/packages/qr-code-scanner/src/qr-code-scanner.js index 191430ddec68867599220a410f2ec72a00c6d5f3..345ac46db0cdf5a28cf424cb4f6d3cde209b49e1 100644 --- a/packages/qr-code-scanner/src/qr-code-scanner.js +++ b/packages/qr-code-scanner/src/qr-code-scanner.js @@ -83,7 +83,6 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) { this.activeCamera = ''; this.sourceChanged = false; - this.clipMask = false; this._devices = new Map(); this._requestID = null; this._loadingMessage = ''; @@ -112,7 +111,6 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) { stopScan: { type: Boolean, attribute: 'stop-scan' }, activeCamera: { type: String, attribute: false }, sourceChanged: { type: Boolean, attribute: false }, - clipMask: { type: Boolean, attribute: 'clip-mask' }, _devices: { type: Map, attribute: false}, _loadingMessage: { type: String, attribute: false }, matchRegex: { type: String, attribute: 'match-regex' }, @@ -255,14 +253,12 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) { let maskStartX = 0; let maskStartY = 0; - if (that.clipMask) { - let maxSize = canvasElement.width > canvasElement.height ? canvasElement.height/4 * 3 : canvasElement.width/4 * 3; - console.assert(maxSize <= canvasElement.width && maxSize <= canvasElement.height); - maskWidth = maxSize; - maskHeight = maxSize; - maskStartX = canvasElement.width/2 - maskWidth/2; - maskStartY = canvasElement.height/2 - maskHeight/2; - } + let maxSize = canvasElement.width > canvasElement.height ? canvasElement.height/4 * 3 : canvasElement.width/4 * 3; + console.assert(maxSize <= canvasElement.width && maxSize <= canvasElement.height); + maskWidth = maxSize; + maskHeight = maxSize; + maskStartX = canvasElement.width/2 - maskWidth/2; + maskStartY = canvasElement.height/2 - maskHeight/2; let code = null; // We only check for QR codes 5 times a second to improve performance