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

Dots style 'dots' problem with type canvas or image download #5

Open
stuk4 opened this issue Jul 20, 2023 · 6 comments
Open

Dots style 'dots' problem with type canvas or image download #5

stuk4 opened this issue Jul 20, 2023 · 6 comments

Comments

@stuk4
Copy link

stuk4 commented Jul 20, 2023

Dots style 'Dots' creates horizontal smears on the upper part of the QR image, in the preview and also the downloaded image if the data length is long.
245516834-0e22fc0b-89e2-4b40-8eb0-9b4cd75cb64e

the same issue that original repo:
kozakdenys#177

@sirwesley
Copy link

I have the same issue for all styles except the 'square' only on PC. on my IOS device all looks good.
Wonder if this is a Browser issue? I'm using Chrome on Windows.

@amaneku-ueshima
Copy link

I don't know why this issue is fixed, but the following code fixes it.

/src/figures/dot/canvas/QRDot.ts
Add context.moveTo(0, 0); to line 66

  _basicDot(args: BasicFigureDrawArgsCanvas): void {
    const { size, context } = args;

    this._rotateFigure({
      ...args,
      draw: () => {
        context.moveTo(0, 0);
        context.arc(0, 0, size / 2, 0, Math.PI * 2);
      }
    });
  }

@felipebel25
Copy link

That's work for me

I don't know why this issue is fixed, but the following code fixes it.

/src/figures/dot/canvas/QRDot.ts Add context.moveTo(0, 0); to line 66

  _basicDot(args: BasicFigureDrawArgsCanvas): void {
    const { size, context } = args;

    this._rotateFigure({
      ...args,
      draw: () => {
        context.moveTo(0, 0);
        context.arc(0, 0, size / 2, 0, Math.PI * 2);
      }
    });
  }

That's work for me! :)

@felipebel25
Copy link

Hellou, i resolved this problem.
This is my library based in qr-code-styling, i fixed this issue and i added more styles to cornerDots and CornerSquares.
https://www.npmjs.com/package/felipe-qr-code-styling

@KilianB
Copy link
Owner

KilianB commented Jul 28, 2023

@felipebel25 would you mind opening a pull request? Then I can also fix it in this fork

@YO-SC
Copy link

YO-SC commented Feb 5, 2024

@felipebel25 would you mind opening a pull request? Then @KilianB can also fix it in this fork 🙏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants