Уменьшил отступы у qr

This commit is contained in:
Ilia Miheev
2026-06-21 00:51:07 +03:00
parent 810bf469f9
commit 72dd57581d
+2 -1
View File
@@ -2,6 +2,7 @@ import { ref, nextTick } from 'vue'
import QRCode from 'qrcode' import QRCode from 'qrcode'
const BASE_QR_SIZE = 256 const BASE_QR_SIZE = 256
const QR_MARGIN = 1
const MAX_WIDTH_RATIO = 0.8 const MAX_WIDTH_RATIO = 0.8
const MIN_SCALE = 0.5 const MIN_SCALE = 0.5
const SCALE_STEP = 0.1 const SCALE_STEP = 0.1
@@ -40,7 +41,7 @@ export function useQrCode() {
if (!canvas || !userText) return if (!canvas || !userText) return
const width = Math.round(BASE_QR_SIZE * scale.value) const width = Math.round(BASE_QR_SIZE * scale.value)
await QRCode.toCanvas(canvas, userText, { width }) await QRCode.toCanvas(canvas, userText, { width, margin: QR_MARGIN })
qrDataUrl.value = canvas.toDataURL('image/png') qrDataUrl.value = canvas.toDataURL('image/png')
} }