neocotic / qrious

Pure JavaScript library for QR code generation using canvas
https://neocotic.com/qrious
Other
1.55k stars 215 forks source link

(#2) Make the QR-code center-aligned #35

Closed mjmasn closed 9 years ago

mjmasn commented 9 years ago

Without this patch applied the QR-code will be aligned to the top-left of the output image/canvas. If the QR-code is smaller than the image size, there will be whitespace to the bottom-right of the image. This patch fixes this by calculating an offset to make the whitespace equal on all sides of the QR-code.

Fixes #2

throrin19 commented 9 years ago

+1

neocotic commented 9 years ago

The only problem that I have with this PR is that it makes too many unrelated changes to formatting. If these could be reverted so that only the necessary changes are included, I'll happily merge this in.

mjmasn commented 9 years ago

@neocotic done :)

neocotic commented 9 years ago

Great! I'll take a look at this tomorrow night. Sorry for the delay with this.

neocotic commented 9 years ago

@mjmasn I've merged your fix and it's been included in v1.1.4 which I've just published. Thanks for all your help!

mjmasn commented 9 years ago

Sweet, thanks!