Removed buggy line drawing around QR codes
This commit is contained in:
parent
5cce3e9043
commit
ac5df27c02
1 changed files with 2 additions and 28 deletions
|
|
@ -176,14 +176,7 @@ function scanQRsend() {
|
||||||
var outputContainer = document.getElementById('output')
|
var outputContainer = document.getElementById('output')
|
||||||
var outputMessage = document.getElementById('outputMessage')
|
var outputMessage = document.getElementById('outputMessage')
|
||||||
var outputData = document.getElementById('outputData')
|
var outputData = document.getElementById('outputData')
|
||||||
function drawLine(begin, end, color) {
|
|
||||||
canvas.beginPath()
|
|
||||||
canvas.moveTo(begin.x, begin.y)
|
|
||||||
canvas.lineTo(end.x, end.y)
|
|
||||||
canvas.lineWidth = 4
|
|
||||||
canvas.strokeStyle = color
|
|
||||||
canvas.stroke()
|
|
||||||
}
|
|
||||||
// Use facingMode: environment to attemt to get the front camera on phones
|
// Use facingMode: environment to attemt to get the front camera on phones
|
||||||
navigator.mediaDevices
|
navigator.mediaDevices
|
||||||
.getUserMedia({video: {facingMode: 'environment'}})
|
.getUserMedia({video: {facingMode: 'environment'}})
|
||||||
|
|
@ -212,26 +205,7 @@ function scanQRsend() {
|
||||||
inversionAttempts: 'dontInvert'
|
inversionAttempts: 'dontInvert'
|
||||||
})
|
})
|
||||||
if (code) {
|
if (code) {
|
||||||
drawLine(
|
|
||||||
code.location.topLeftCorner,
|
|
||||||
code.location.topRightCorner,
|
|
||||||
'#FF3B58'
|
|
||||||
)
|
|
||||||
drawLine(
|
|
||||||
code.location.topRightCorner,
|
|
||||||
code.location.bottomRightCorner,
|
|
||||||
'#FF3B58'
|
|
||||||
)
|
|
||||||
drawLine(
|
|
||||||
code.location.bottomRightCorner,
|
|
||||||
code.location.bottomLeftCorner,
|
|
||||||
'#FF3B58'
|
|
||||||
)
|
|
||||||
drawLine(
|
|
||||||
code.location.bottomLeftCorner,
|
|
||||||
code.location.topLeftCorner,
|
|
||||||
'#FF3B58'
|
|
||||||
)
|
|
||||||
outputMessage.hidden = true
|
outputMessage.hidden = true
|
||||||
outputData.parentElement.hidden = false
|
outputData.parentElement.hidden = false
|
||||||
outputData.innerText = JSON.stringify(code.data)
|
outputData.innerText = JSON.stringify(code.data)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue