gianu / react-fittext

React Plugin to fit text on the screen
http://softwarepsychonaut.com/react-fittext
MIT License
218 stars 51 forks source link

Ratio based switching to height relative resize #20

Closed sepion02 closed 7 years ago

sepion02 commented 7 years ago

Why not Add the ability to switch resize mode according to the height of the container div above a pre-determined aspect ratio.

Adding switchRatio parameter. User can pass this parameter if he wants the text size to fit the height of the div above this given ratio. Adding heightCompressor parameter to control the text size according to the height. Modifying "compressor" parameter name to "widthCompressor" for coherency purpose

usage : <ReactFitText switchRatio={2.8} heightCompressor={0.1} widthCompressor={0.2}>

test

ReactFitText.zip

denis-sokolov commented 7 years ago

Thanks for trying to help! It seems that you used incorrect branches to submit a PR. Please consider submitting a new PR with the branch with your changes on it.