mnahkies / ng-qrcode

Easy to use AOT compatible QR code generator for Angular projects.
https://mnahkies.github.io/ng-qrcode/
MIT License
53 stars 10 forks source link

feat: support changing canvas margin #37

Closed mnahkies closed 3 years ago

mnahkies commented 3 years ago

add new input property "margin" to the component, and "qrCodeMargin" to the directive that allows configuring the amount of whitespace is surrounding the image that is output to the canvas.

Keep backwards compatibility by defaulting to 4, however I suspect this is probably easiest to reason about if it was 0 and normal css padding/margin was used in it's place, so may change the default in the next major version.

closes #36

razzeee commented 3 years ago

For some more context, it seems like the standard is suggesting 4 (things) of spacing. So it might be a sensible default. https://www.qrcode.com/en/howto/code.html

It just seems like our designers didn't know / decided against it.

mnahkies commented 3 years ago

For some more context, it seems like the standard is suggesting 4 (things) of spacing. So it might be a sensible default. https://www.qrcode.com/en/howto/code.html

It just seems like our designers didn't know / decided against it.

Oh that's interesting thanks! It's not something I'd really thought about until you raised the issue, as I've always thought it looked fine with the default value. Keeping 4 as the default long term seems sensible with that added context though