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

Line-height and timing issues. #63

Open
SamTheDev85 opened this issue Aug 25, 2022 · 2 comments
Open

Line-height and timing issues. #63

SamTheDev85 opened this issue Aug 25, 2022 · 2 comments

Comments

@SamTheDev85
Copy link

I found that line-height can break the script if the line-height is larger than the element size. To work around this (I need to adjust the line height to get the font to center), I set the line-height style to normal then call the script and clear the normal setting after completion.

I am getting inconsistent results on the first execution of a fresh browser window. The same element on first calculation of a fresh browser instance will result in 32px but in later calculations, the correct result of 35px is achieved. I thought this would be because the function does not return fast enough so I tried wrapping it into a promise. Does the script have callbacks perhaps onComplete?

@STRML
Copy link
Owner

STRML commented Aug 25, 2022

It's synchronous, so no callback is necessary.

@SamTheDev85
Copy link
Author

Can you think of anything that might be causing the disparity?

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