ng-FitText.js icon indicating copy to clipboard operation
ng-FitText.js copied to clipboard

Resizing of dynamic text - does not work when data changes constantly

Open nehaverma8 opened this issue 9 years ago • 4 comments

I have a widget that can be resized to any size. I have several lines of text inside it that need to scale when the widget resizes. One of the text changes constantly ( like stock price)

The issue I see is that when the stock price value is updated (every 5 sec or so) , the text does not resize and appears out of the container.

eg.

``` kjhkj`

{{name}}

{{price}} {{attr1}}

`

nehaverma8 avatar May 25 '16 18:05 nehaverma8

I have tested an interval creating a random number and it works as expected. May be an issue with the font itself. If you highlight the fonts characters do some of the characters overflow the highlight? eg: screen shot 2016-05-26 at 11 58 28 am

If so, you'll have to play around with the compressor value: data-fittext=".9" for instance, or use a font that has proper bounds.

patrickmarabeas avatar May 26 '16 02:05 patrickmarabeas

I have the same issue. Resizing the screen resizes te text perfectly, however when the text is changed dynamically it's not being updated

Edit: I hacked it using this trick https://github.com/patrickmarabeas/ng-FitText.js/issues/46#issuecomment-213311002

danielcha avatar Jun 04 '16 19:06 danielcha

Nice one. I'll follow up on this as soon as I can.

patrickmarabeas avatar Jun 06 '16 03:06 patrickmarabeas

@danielcha any chance you can make a codepen demonstrating the issue?

patrickmarabeas avatar Jun 12 '16 11:06 patrickmarabeas