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

While resizing from max height to min height the font is not resizing. #20

Open
ghost opened this issue Oct 9, 2019 · 0 comments
Open

Comments

@ghost
Copy link

ghost commented Oct 9, 2019

I am facing an issue where when I resize an html panel from 400px height to 200px by keeping width as constant then the Font Size does not resize as per the new height.

Below are my props passed
minFontSize = 12 maxFontSize = 600 and widthOnly = false

In order to solve this issue I had done a change in the file src/get-fillsize.js function - getFillSize I have changed this line

let fontSize = Math.min(
Math.max(Math.min(Number(el.offsetWidth) / (factor * 10), maxFontSize), minFontSize)
);

to
let fontSize = Math.min(
Math.max(Math.min(Number(el.offsetHeight) / (factor * 10), maxFontSize), minFontSize)
);
In order to solve my issue and is working I need help from you whether I can patch this as hotfix in your new release.

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

0 participants