Commit de2cab2f authored by erio's avatar erio Committed by 陈曦
Browse files

fix(frontend): lower QR code error correction level to reduce density

Closes #1607
parent 0e2a3901
...@@ -154,7 +154,7 @@ async function renderQR() { ...@@ -154,7 +154,7 @@ async function renderQR() {
await QRCode.toCanvas(qrCanvas.value, qrUrl.value, { await QRCode.toCanvas(qrCanvas.value, qrUrl.value, {
width: 220, width: 220,
margin: 2, margin: 2,
errorCorrectionLevel: logoSrc ? 'H' : 'M', errorCorrectionLevel: logoSrc ? 'M' : 'L',
}) })
if (!logoSrc) return if (!logoSrc) return
const canvas = qrCanvas.value const canvas = qrCanvas.value
......
...@@ -199,7 +199,7 @@ async function renderQR() { ...@@ -199,7 +199,7 @@ async function renderQR() {
if (!qrCanvas.value || !qrUrl.value) return if (!qrCanvas.value || !qrUrl.value) return
await QRCode.toCanvas(qrCanvas.value, qrUrl.value, { await QRCode.toCanvas(qrCanvas.value, qrUrl.value, {
width: 220, margin: 2, width: 220, margin: 2,
errorCorrectionLevel: 'H', errorCorrectionLevel: 'M',
}) })
} }
......
...@@ -94,12 +94,12 @@ async function renderQR() { ...@@ -94,12 +94,12 @@ async function renderQR() {
await nextTick() await nextTick()
if (!qrCanvas.value || !qrUrl.value) return if (!qrCanvas.value || !qrUrl.value) return
// Use high error correction to support logo overlay // Use medium error correction to support logo overlay while keeping QR code scannable
const logoSrc = getLogoForType() const logoSrc = getLogoForType()
await QRCode.toCanvas(qrCanvas.value, qrUrl.value, { await QRCode.toCanvas(qrCanvas.value, qrUrl.value, {
width: 256, width: 256,
margin: 2, margin: 2,
errorCorrectionLevel: logoSrc ? 'H' : 'M', errorCorrectionLevel: logoSrc ? 'M' : 'L',
}) })
if (!logoSrc) return if (!logoSrc) return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment