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

Float line-height #11

Open
alexanderhook opened this issue May 9, 2019 · 0 comments
Open

Float line-height #11

alexanderhook opened this issue May 9, 2019 · 0 comments

Comments

@alexanderhook
Copy link

For the elements which have line-height written as a float number there is an issue in calculation, due to truncation of decimal part.
e.g. for line-height: 18.5667px
parseInt('18.5667px', 10) // 18
parseFloat('18.5667px') // 18.5667

Suggestion is to update how maximumHeight is calculated:

module.exports = function (rootElement, lineCount, options) {
  ...
  var maximumHeight = Math.round(
      (lineCount || 1) *
      parseFloat(window.getComputedStyle(rootElement).lineHeight))
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

1 participant