diff --git a/.changeset/nine-trainers-sip.md b/.changeset/nine-trainers-sip.md new file mode 100644 index 00000000..f0dec850 --- /dev/null +++ b/.changeset/nine-trainers-sip.md @@ -0,0 +1,5 @@ +--- +'@svelte-put/qr': patch +--- + +correctly position logo to center diff --git a/packages/misc/qr/src/qr/index.js b/packages/misc/qr/src/qr/index.js index c0856751..9e191f2b 100644 --- a/packages/misc/qr/src/qr/index.js +++ b/packages/misc/qr/src/qr/index.js @@ -81,8 +81,8 @@ export function createSVGParts(config, qr) { if (logo) { const safelyRemovableSize = Math.floor(count * Math.sqrt(0.1)); const { width, height } = calculateLogoSize(safelyRemovableSize * 0.8, logoRatio); - const x = (size - width) / 2; - const y = (size - height) / 2; + const x = (size + margin - width) / 2; + const y = (size + margin - height) / 2; logoSvg = ``; } diff --git a/packages/misc/qr/types/index.d.ts.map b/packages/misc/qr/types/index.d.ts.map index 2239670b..2dbf97da 100644 --- a/packages/misc/qr/types/index.d.ts.map +++ b/packages/misc/qr/types/index.d.ts.map @@ -34,5 +34,5 @@ null, null ], - "mappings": ";;;;;iBA0BgBA,cAAcA;;;;;;;;;;;;;;iBAgFdC,SAASA;;;;iBAYTC,iBAAiBA;;;;OC9GrBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCKEC,SAASA;;;;iBAqBfC,EAAEA;kBCpBDC,aAAaA;;;;;OCXlBC,cAAcA;;;;;OAMdC,eAAeA;;;;;OAQfC,iBAAiBA;;;;OHTjBN,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBICJE,EAAEA;OCLNK,cAAcA;;;;;OAMdC,eAAeA;;;;;OAQfC,iBAAiBA;;;;OLVjBT,QAAQA" + "mappings": ";;;;;iBA0BgBA,cAAcA;;;;;;;;;;;;;;iBAgFdC,SAASA;;;;iBAYTC,iBAAiBA;;;;OC9GrBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCKEC,SAASA;;;;iBAqBfC,EAAEA;kBCpBDC,aAAaA;;;;;OCXlBC,cAAcA;;;;;OAMdC,eAAeA;;;;;OAQfC,iBAAiBA;;;;OHTjBN,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBICJE,EAAEA;OCNNK,cAAcA;;;;;OAMdC,eAAeA;;;;;OAQfC,iBAAiBA;;;;OLTjBT,QAAQA" } \ No newline at end of file