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

Miscomputation of width #8

Open
SpiritusDeos opened this issue Mar 1, 2019 · 1 comment
Open

Miscomputation of width #8

SpiritusDeos opened this issue Mar 1, 2019 · 1 comment

Comments

@SpiritusDeos
Copy link

Hi,

When using your library with following options, I got a miscomputation of the width:

font: 'Helvetica';
fontSize: '14px';
fontWeight: '400'

For example, Lalande de Pomerol and Bordeaux Supérieur get the same width (125px), while they shouldn't have.

The fix could be to use getBoundingClientRect().width instead of offsetWidth() in the computation (same for height).

@alisonmonteiro
Copy link

@klouzoun Using the getBoundingClientRect().width the result is always a float value. The offsetWidth seems to be returning the rounded version of that.

What about a "strict mode" as an option, where I can get the float (real) result? 🤔

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

2 participants