From ec2683725d87ed6dcc8547781eda6dd6111c1790 Mon Sep 17 00:00:00 2001 From: Denys Kozak Date: Thu, 17 Oct 2024 16:54:17 +0300 Subject: [PATCH] Add viewBox --- src/core/QRSVG.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/QRSVG.ts b/src/core/QRSVG.ts index f7648cf0..66ee54e9 100644 --- a/src/core/QRSVG.ts +++ b/src/core/QRSVG.ts @@ -53,6 +53,7 @@ export default class QRSVG { this._element.setAttribute("width", String(options.width)); this._element.setAttribute("height", String(options.height)); this._element.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink"); + this._element.setAttribute("viewBox", `0 0 ${options.width} ${options.height}`); this._defs = this._window.document.createElementNS("http://www.w3.org/2000/svg", "defs"); this._element.appendChild(this._defs);