Upgrade vue-qr-code-reader and fix scanning issue

This commit is contained in:
Dennis Reimann 2021-10-21 15:22:51 +02:00 committed by Andrew Camilleri
parent 926b60df3d
commit 493f1b98c2
3 changed files with 16 additions and 12 deletions

View file

@ -172,18 +172,21 @@ function initCameraScanningApp(title, onDataSubmit, modalId) {
logErrors(promise) {
promise.catch(console.error)
},
paint(location, ctx) {
ctx.fillStyle = '#137547';
[
location.topLeftFinderPattern,
location.topRightFinderPattern,
location.bottomLeftFinderPattern
].forEach(({ x, y }) => {
ctx.fillRect(x - 5, y - 5, 10, 10);
})
paint(detectedCodes, ctx) {
for (const detectedCode of detectedCodes) {
const [ firstPoint, ...otherPoints ] = detectedCode.cornerPoints
ctx.strokeStyle = "#51b13e";
ctx.beginPath();
ctx.moveTo(firstPoint.x, firstPoint.y);
for (const { x, y } of otherPoints) {
ctx.lineTo(x, y);
}
ctx.lineTo(firstPoint.x, firstPoint.y);
ctx.closePath();
ctx.stroke();
}
},
onInit(promise) {
promise.then(() => {
this.errorMessage = null;
if (app.cameras.length === 1)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long