kazuhikoarase / qrcode-generator

QR Code Generator implementation in JavaScript, Java and more.
https://kazuhikoarase.github.io/qrcode-generator/js/demo/
MIT License
2.1k stars 674 forks source link

createASCII without margin error #66

Closed jlami closed 5 years ago

jlami commented 5 years ago

When I call createASCII with a margin of 0 and when the size of the qr code is odd, the last line is cut of and replaced with a half border.

I think the condition to substring and concat the half border should be if (*size % 2) && r) at https://github.com/kazuhikoarase/qrcode-generator/blob/a4ce043c3d8edcb469f07d2db9d4da3527d23f41/js/qrcode.js#L619

https://codepen.io/anon/pen/KJdwXg

ahwayakchih commented 5 years ago

@jlami thanks for report.

I could reproduce it only for cell size set to 1. With cell sizes bigger than 2, generated output was OK here.

Please check fix from #68 and confirm it works :).

jlami commented 5 years ago

Yes this works!

ahwayakchih commented 5 years ago

Great! Thanks :).