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

i cann't set margin #45

Closed
aduonggm opened this issue Apr 15, 2021 · 3 comments
Closed

i cann't set margin #45

aduonggm opened this issue Apr 15, 2021 · 3 comments

Comments

@aduonggm
Copy link

No description provided.

@davemecha
Copy link

davemecha commented Apr 23, 2021

@aduonggm you could have provided a better description :(

I'm experiencing the same problem.

I can't set the global margin with version 1.3.4 in react. The problem also occurs on the react example linked in the readme.

What also is to mention: margin is not part of the typescript definition as well so it throws an type error. Exported configs from the website don't make it through typescript validation.

@awran5
Copy link

awran5 commented May 28, 2021

I'm facing the same issue. It seems that the margin property is just missing from Options declaration at
qr-code-styling/lib/core/QROptions file.

As a workaround I did:

import { Options } from 'qr-code-styling/lib/core/QROptions'

interface MissingOption extends Options {
  margin?: number
}
...

const qrCode = new QRCodeStyling({
  width: ...,
  height: ...,
  margin: 10, // Add missing margin
  image: ...,
  dotsOptions: {},
  imageOptions: {},
} as MissingOption) // add extended interface

@kozakdenys
Copy link
Owner

@aduonggm @davemecha @awran5 thanks for your help
the bug was fixed in 1.4.2 varsion

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

4 participants