Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
Bunlong committed Nov 14, 2022
1 parent ecabedb commit 94eb6d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/useQRCode.tsx
Original file line number Diff line number Diff line change
@@ -101,8 +101,8 @@ function useCanvasComponent() {
};
} else if (!logo?.options?.x || !logo?.options?.y) {
let margin = options?.margin;
margin = !margin ? (margin === 0 ? 0 : 32) : (margin * 8);
const width = options?.width || (116 + margin);
margin = !margin ? (margin === 0 ? 0 : 32) : margin * 8;
const width = options?.width || 116 + margin;
const center = (width - logoWidth) / 2;
img.onload = function () {
ctx.drawImage(img, center, center, logoWidth, logoWidth);

0 comments on commit 94eb6d0

Please sign in to comment.