You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes you'll get "font-size: 0px", this is my solution..
Break out the value var value = Math.max(Math.min($this.width() / (compressor * 10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize));
Basicly check if the font-size is 0 if (value !== 0) { $this.css('font-size', value); }
Works fine for me.
/R
The text was updated successfully, but these errors were encountered:
@RobinBertilsson I realize you posted this quite awhile ago. But could you post a CodePen or something that demonstrates the problem? Or are you just saying it'd be good to never set the font-size to 0 ever?
Hey sorry, missed that you replied, cant rly figure out what caused it atm. But i'd say skip font-size: 0, why would you "fittext" a text with fontsize 0 :)
I'm currently having a similar issue where its calculating 0 for font-size because its currently within a hidden div in my view. Haven't found a way around it but just wanted to share one case the same event occurs.
Sometimes you'll get "font-size: 0px", this is my solution..
var value = Math.max(Math.min($this.width() / (compressor * 10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize));
if (value !== 0) { $this.css('font-size', value); }
Works fine for me.
/R
The text was updated successfully, but these errors were encountered: