react-scale-text icon indicating copy to clipboard operation
react-scale-text copied to clipboard

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

Open ghost opened this issue 6 years ago • 0 comments

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.

ghost avatar Oct 09 '19 16:10 ghost