Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Size of QR code (and quiet zone) on Android is awkward #151

Open
rugk opened this issue Nov 28, 2018 · 1 comment
Open

Size of QR code (and quiet zone) on Android is awkward #151

rugk opened this issue Nov 28, 2018 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@rugk
Copy link
Owner

rugk commented Nov 28, 2018

It works somewhat strangely:

  • always "auto-scaling" enabled
  • if you have it in the SVG mode: the padding (quiet zone) is nowhere shown, it is likely outside of the menu
  • if in Canvas mode: although you only have a quiet zone of 1, you get a quite small QR code (at the top!)

Both looks strange…

@rugk rugk added the bug Something isn't working label Nov 28, 2018
@rugk
Copy link
Owner Author

rugk commented Nov 29, 2018

Okay, actually the issue is a big CSS thing… so I tried around a little and there are multiple cases:

  • we set width: auto in order to horizontally center the qr code if it is a canvas here:
    qrCodeResizeContainer.style.width = "auto";
  • also the SVG and Canvas handling is totally different. Canvas is resized manually when the popup resizes, SVG does not need this thanks to it's dynamically "resizability":
    if (qrCodeSizeOption.sizeType !== "auto") {
    qrCodeResizeContainer.style.width = `${newSize}px`;
    qrCodeResizeContainer.style.height = `${newSize}px`;
    }

This results in:

  • if you remove the width: auto and use width: 100% of the qrcode-resize-area, the SVG is correctly resized and the padding is visible
  • manually setting the size is likely also not a good idea in the Canvas way, as this obviously also is the wrong size for the container, actually, as the padding ("quiet zone") is added to the size of the QR code itself…

Also the CSS may generally need some redoing. I maybe need to separate the SVG and Canvas handling in CSS a bit more, e.g.…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant