I want to use the resulting font size after textFit() has been executed, something like this:
fitText(...);
doSomethingElse();
I'm finding that doSomethingElse() is being called before fitText() has done it's thing, so the I'm getting the original font size. Wrapping doSomethingElse() in a timeout helps, but introduces a lag into the UI.
Is there a way to set-up a callback so that doSomethingElse() is only run after fitText() has finished?
If you're using the master version (and not the example script), textFit() is synchronous. It shouldn't be possible for anything to run before it's finished. Could you post a jsfiddle?
Thanks for an awesome library, works great!
I want to use the resulting font size after
textFit()
has been executed, something like this:I'm finding that
doSomethingElse()
is being called beforefitText()
has done it's thing, so the I'm getting the original font size. WrappingdoSomethingElse()
in a timeout helps, but introduces a lag into the UI.Is there a way to set-up a callback so that
doSomethingElse()
is only run afterfitText()
has finished?